Boost logo

Boost Users :

Subject: Re: [Boost-users] bind: what am I doing wrong here?
From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2009-04-15 12:02:17


Peter Dimov wrote:
> Noah Roberts:
>
>> // won't compile:
>> std::transform(m.begin(), m.end(), keys.begin(),
>> boost::bind(&std::pair<std::string,Test>::first, _1));
>
> The value type of the map m is pair<string const, Test> - note the
> const. Use the value_type typedef:
>
> typedef std::map<std::string, Test> map_type;
>
> std::transform( m.begin(), m.end(), keys.begin(),
> boost::bind(&map_type::value_type::first, _1) );

It would be something basic. Thanks.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net