Hi,
Is there a way of automatic placeholder argument dereferencing when
using bind()? I mean:
struct SomePredicate
{
bool operator()(int num, const Foo& foo) const
{
return SomeTestOnFoo(num, foo);
}
}
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);
I don't want to use indirect() adaptor from boost.range because I want
final output range to still have Foo* as value_type so that it can still be
copied to another std::vector etc.
So: is there a way of telling bind() that is should dereference
a placeholder argument before passing it to underlying bound functor?
Regards,
Simon
--
Szymon Gatner
The Lordz Games Studio
www.thelordzgamesstudio.com