|
Boost : |
From: John Torjo (john.lists_at_[hidden])
Date: 2003-11-20 05:30:18
>>
>> Something like:
>> std::map< std::string, int> c;
>> std::vector<std::string> v;
>>
>> // copy all the keys into v
>> std::copy( c.begin(), c.end(),
>> boost::bind<std::string>( select1st(), std::back_inserter(v));
>>
>> Can select1st be used, or is there some other utility function? Thanks.
>
>
> This is a compile time equivalent of your code:
>
> typedef mpl::vector<
> mpl::pair<.., ..>
> , mpl::pair<.., ..>
> , ...
> > c;
>
> typedef mpl::transform<
> c
> , mpl::select1st<>
> >::type v;
>
Thanks.
Thought it was too easy ;)
Anyway, did my own thing.
(needed it for use in the rtl;))
Best,
John
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk