Base Pointer member functions failure

Okay,
Call me stupid but I can't get this to work
class Base
{
virtual const bool CheckFunc(const value& val ) const { return true;
}
}
class Derived1: public Base
{
}
class Derived2: public Base
{
}
// some where else in code
Derived1 dev1;
Derived2 dev2;
vector

Mark Loew wrote:
Okay,
Call me stupid but I can't get this to work
class Base { virtual const bool CheckFunc(const value& val ) const { return true; } }
[...]
std::find_if( vecBase.begin(), vecBase.end(), boost::bind(Base::CheckFunc, aVal ) );
Try boost::bind(&Base::CheckFunc, _1, aVal) instead. Remember that a member function has an implicit 'this' argument.
participants (3)
-
Douglas Gregor
-
Mark Loew
-
Peter Dimov