
David Abrahams writes:
"Peter Dimov" <pdimov@mmltd.net> writes:
David Abrahams wrote:
Terje Slettebø <tslettebo@broadpark.no> writes:
// int_vector r_list = to_runtime<c_list>();
int_vector r_list;
boost::mpl::for_each<c_list>(to_sequence<int_vector>(r_list));
Better yet:
int_vector r_list; boost::mpl::for_each<c_list>(std::back_inserter(r_list));
Enjoy ;-)
Um, how does this work? back_inserter returns an iterator, not a function object; is there some magic in mpl::for_each that I can't see? Maybe I'm looking at the wrong version?
No, I'm just an idiot :(. Please ignore my post.
This should work, though: int_vector r_list; boost::mpl::for_each<c_list>( boost::bind(&int_vector::push_back, &r_list, _1) ); -- Aleksey Gurtovoy MetaCommunications Engineering