
17 Jul
2008
17 Jul
'08
7:39 a.m.
Given a bit of code like this, struct S { bool pred( ) const; }; typdef vector<pair<string, S *> > V; V :: const_iterator i; i -> second -> pred( ); I'd like to rewrite the last line as a lambda expression. Looking at the documentation, I think this is done with bind( & S :: pred, bind( & V :: value_type :: second, _1 ) )( * i ); which works. But I'd rather be writing something like ( _1 -> second -> pred )( * i ); Am I right in thinking that Boost.Lambda just doesn't work like this, and the frst form is how it's done? Thanks, Rob.