Douglas Paul Gregor <[EMAIL PROTECTED]> writes: > Why don't we have > > mpl::list<int, float, double, std::string> list_of_types; > for_each(list_of_types.begin(), list_of_types.end(), f); > > ? > > Then an unqualified for_each call can handle type sequences, heterogeneous > containers (e.g., tuple), and run-time sequences (e.g., vector). It's been > done before, elsewhere, so why don't we do it in MPL?
It's clever, but I'm not sure what problem it's solving. AFAICT it doesn't solve the problem that Andrei was pointing at. It also has at least one problem: it is intrusive on sequence types, requiring them to have begin()/end() member functions. If this was the only way to do it, it would break interoperability with 3rd-party type sequences. -Dave -- David Abrahams [EMAIL PROTECTED] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost