|
Boost Users : |
Subject: Re: [Boost-users] [Lambda] Handling Bind/Lambda name clashes.
From: Peter Dimov (pdimov_at_[hidden])
Date: 2011-04-05 09:27:32
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.
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