
typedef boost::function<void (RegressionTestScenario*, const std::string &)> 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<void (RegressionTestScenario*, const std::string &)> -- 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...