On Sat, Jul 2, 2011 at 1:21 PM, Igor R
typedef boost::function
actionFuntion; typedef boost::shared_ptr<actionFuntion> actionFuntionPtr; <...> class CurveGenRegressionTestScenario : public RegressionTestScenario { public: void changeBaseDate(const std::string &argument); <...> and I am trying to use the following: actionFuntion funPtr; funPtr = &CurveGenRegressionTestScenario::changeBaseDate;
but it fails. I have no idea why. Could someone give me a hint?
boost::function
-- is a callable with 2 arguments. &CurveGenRegressionTestScenario::changeBaseDate -- is a ptr to a member function. These 2 types are incompatible. You probably should look at Boost.Bind to accomplish your task: http://www.boost.org/doc/libs/1_46_1/libs/bind/bind.html#with_member_pointer...
I was going to suggest boost::bind(), but when I put the trimmed-down code above into a source file, changed it to a boost::bind() expression and tried to compile it with g++, it complained about the type incompatibility. So there are two different problems, one of which is inheritance.