5 Apr
2011
5 Apr
'11
1:27 p.m.
Robert Jones wrote: ...
int main( ) { boost::lambda::placeholder1_type x; boost::lambda::placeholder2_type y;
std::vector<X> v;
std::accumulate( boost::begin( v ), boost::end( v ), 0, bind( sum, x, bind( &X::f, y ) ) ); }
You're relying on argument-dependent lookup here and it works only because x and y happen to be in namespace boost::lambda. A using declaration for boost::lambda::bind: using boost::lambda::bind; should be a better choice.