Boost logo

Boost Users :

From: Mark Loew (mloew_at_[hidden])
Date: 2003-09-26 16:58:09


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<Base *> vecBase;
vecBase.push_back( &dev1 );
vecBase.push_back( &dev2 );
 
value aVal;
vec<Base *> std::find_if( vecBase.begin(), vecBase.end(), boost::bind(
Base::CheckFunc, aVal ) );
 
I have tried a gazillion things a thought would work using mem_fun_ref
and such. This ones get's me the closest I believe but I get a bunch of
qualifier to funcation type has no meaning warnings. As well I get a
condiation expression of type 'overloaded-function is illegal.
 
I am using VS.Net 2003.
 
Any ideas on what I am missing. As well can I get my cake and eat it to
by making the CheckFunc virtual and have it resolve to the derived form?
 
 
TIA
Mark Loew, MCSD, MCSE
Application Development Consultant
Sagestone Consulting
www.sagestone.com <http://www.sagestone.com/>
Grand Rapids, MI
616-954-9556 x149
Microsoft Gold Certified Partner
mloew_at_[hidden]
 



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