9 Sep
2011
9 Sep
'11
2:48 p.m.
On Fri, Sep 9, 2011 at 10:04 AM, Ivan Le Lann
Is there a way of automatic placeholder argument dereferencing when using bind()? I mean:
std::vector
foos; // line below gives compilation error because second argument passed // to functor is Foo* and not Foo.
std::for_each(foos.begin(), foos.end(), bind(SomePredicate(), 123, _1);
From http://www.boost.org/doc/libs/1_47_0/doc/html/lambda/le_in_details.html#id21... (section "Sizeof and typeid")
for_each(a.begin(), a.end(), cout << bind(&type_info::name, ll_typeid(*_1)));
Have you tried *_1 ?
I think that works with boost::lambda::bind and boost::lambda::_1 (also, presumably, the corresponding constructs in Phoenix) but not with plain boost::bind.