Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-10-10 07:17:50


David Abrahams wrote:
> Terje Slettebø <tslettebo_at_[hidden]> 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?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk