On Fri, Jul 1, 2011 at 1:06 PM,
I have a simple inheritance:
class RegressionTestScenario;
typedef boost::function
actionFuntion; class RegressionTestScenario { public: virtual ~RegressionTestScenario() {} };
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?
The inheritance is going the wrong way. An actionFuntion instance
might be called with any RegressionTestScenario*. But you can't call a
CurveGenRegressionTestScenario method with any old
RegressionTestScenario* -- only a RegressionTestScenario* that is also
a CurveGenRegressionTestScenario* would be valid. The compiler isn't
going to synthesize logic for you to
dynamic_cast