Boost logo

Boost Users :

Subject: Re: [Boost-users] bind: what am I doing wrong here?
From: Alex MDC (alex.mdc_at_[hidden])
Date: 2009-04-14 19:57:16


>
> // won't compile:
> std::transform(m.begin(), m.end(), keys.begin(),
> boost::bind(&std::pair<std::string,Test>::first, _1));

Try adding a const to the key type: &std::pair<const
std::string,Test>::first

I think the keys in a map are always returned const. Changing them could
lead to unsorted maps and weird behaviour.

Regards,
Alex



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