Boost logo

Boost Users :

From: joaquin_at_[hidden]
Date: 2008-07-17 10:37:02


joaquin_at_[hidden] escribió:
> Eric MALENFANT escribió:
>
>> As shown here:
>> http://www.boost.org/doc/libs/1_35_0/doc/html/lambda/le_in_details.html#lambda.function_pointers_as_targets,
>> the bind() is unavoidable, but it does not have to be that explicit.
>> This should work:
>> std::for_each(functors.begin(), functors.end(), bind(_1));
>>
>>
>>
>
> Cute! Hadn't realized the first argument of bind can also be filled by a
> placeholder.
>
> Joaquín M López Muñoz
> Telefónica, Investigación y Desarrollo
>

With Boost.Bind, however, the same trick does not work:

  std::for_each(
    functors.begin(), functors.end(),
    boost::bind(::_1));

This does not invoke operator() on the functor objects.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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