Boost logo

Boost Users :

Subject: Re: [Boost-users] [bind maybe?] find_if of map mapped_type.
From: Roman Perepelitsa (roman.perepelitsa_at_[hidden])
Date: 2009-06-04 05:21:09


2009/6/4 Robert Jones <robertgbjones_at_[hidden]>

> If I'm iterating over a map with, say find_if, and my predicate
> function accepts the mapped_type of the map, is there a mechanism
> to pick out the pair.second value inline?
>
> class C;
>
> map< int, C > m;
>
> bool pred( const C & );
>
> // correct version of this intent.
> find_if( m.begin( ), m.end( ), pred( second ) );
>

find_if(m.begin(), m.end(), bind(pred, bind(&map<int,
c>::value_type::second, _1)))

Roman Perepelitsa.



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