Re: [boost] Re: mpl::for_each and polymorphic function object

Gennadiy Rozental wrote:
mpl::for_each<mpl::transform<s, wrap<_1> >::type>(foo());
I saw this in mpl::for_each test.
Actually, if you do it as in the test, it's even simpler: mpl::for_each< types,wrap<_1> >(foo());
It may probably solve my problem. But is tyhe more generic solution?
Sorry, cannot parse this one.
Or why doesn't for each pach mpl::identity in a first place?
Sometimes the value semantics is exactly what you want: typedef mpl::range_c<int,0,10> numbers; std::vector<int> v; mpl::for_each<numbers,mpl::_>( boost::bind(push_back, &v, _1) );
Or could we eliminate parameter at all and make for_each to work with explicit type specialization, like this:
aux::unwrap(f, 0)::operator()<arg>();
Like the previous suggestion, it would rule out ordinary function objects; besides, it's not portable. -- Aleksey Gurtovoy MetaCommunications Engineering
participants (1)
-
Aleksey Gurtovoy