Boost logo

Boost Users :

Subject: Re: [Boost-users] Using function operator in lambda expression
From: Niklas Angare (li51ckf02_at_[hidden])
Date: 2011-06-03 11:38:41

"Alexander Khomyak" wrote:
> According lambda documentation
> <
> #lambda.operator_expressions> there is a possibility to use function
> call operator in lambda expression.
> (_1(1))(foo);

_1 is can be seen as a function object that returns its first argument.
_1(1) calls that function object with 1, the result of which is 1.

I think this is what you want:
bind(_1, 1)(&foo); // Equivalent to foo(1)

You have to include boost/lambda/bind.hpp to use bind.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at