"Joel de Guzman" <[EMAIL PROTECTED]> writes: > ----- Original Message ----- > From: "Aleksey Gurtovoy" <[EMAIL PROTECTED]> > > >> Joel de Guzman wrote: >> > Here's the Phoenix version: >> > >> > struct my_function_ >> > { >> > >> > template <typename Arg1T, typename Arg2T> >> > struct result { typedef void type; }; >> > >> > template< typename U > >> > void operator()(std::string const& text, U) >> > { >> > // ... >> > } >> > >> > }; >> > >> > function<my_function_> my_function; // here! >> > >> > Then: >> > >> > mpl::for_each< my_types >(my_function(text, _1)); >> >> This is way too cool! Now we only need to provide such free-standing forms >> of all STL algorithms/member functions, and we will be living in a different >> world: >> >> std::vector<std::string> v; >> >> push_back(v, "text"); // plain call >> for_each(input, push_back(v, _1)); // currying >> for_each(v, for_each(_1, print_char)); // more currying >> // etc.! >> >> Breathtaking, IMO. > > That was my intent.
I'd like you to take my breath, too, but I'm not as quick as Aleksey. I tried to compile your code but I couldn't come up with a plausible definition for function<...>. Could you fill in some details? -- 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