Bugzilla – Bug 48
Create function and parameters that are from virtual classes
Last modified: 2008-06-05 12:44:18 EDT
Is it normal that the Create function works only if ontime and offtime are not from a class that has virtual functions? That is, if I define them as ConstantVariable, then it compiles, but if I define than as RandomVariable (virtual base class) and pass in a ConstantVariable (derived class), then it won't compile telling me that the RandomVariable class has some pure virtual functions. FunctionXX(const RandomVariable& ontime, const RandomVariable& offtime) { m_onOffGenerator = Create<OnOffGenerator> (ontime, offtime); } Thanks, Emmanuelle
(In reply to comment #0) > Is it normal that the Create function works only if ontime and offtime are not > from a class that has virtual functions? That is, if I define them as > ConstantVariable, then it compiles, but if I define than as RandomVariable > (virtual base class) and pass in a ConstantVariable (derived class), then it > won't compile telling me that the RandomVariable class has some pure virtual > functions. > > FunctionXX(const RandomVariable& ontime, const RandomVariable& offtime) > { > m_onOffGenerator = Create<OnOffGenerator> (ontime, offtime); > } Could you provide a reduced test case without OnOffGenerator ?
mark as INVALID? (no test case provided)
ok.