I need to call a function declared like this:
and also overloaded like this:Code:bool addParameterEntry(const string& name, ObjectType& object, ValueType ObjectType::* object_val_ptr);
I have been calling it like this:Code:template <class FunctorType, class ValueType> bool addParameterEntry(const string& name, FunctorType* fctr);
where ExpWaveProb looks like:Code:paramLib.addParameterEntry("Q", problem, &ExpWaveProb::Q);
But now that I have made Q a member of WaveProb (and thus ExpWaveProb inherits it), the call above generates the error:Code:class ExpWaveProb : public WaveProb { public: double Q; //... }
no matching function for call to `LOCA::Parameter::Library::addParameterEntry(const char[2], ExpWaveProb&, double WaveProb::*)'
What would be the easiest way to fix this without changing the addParameterEntry method?
Thanks,
Josh
P.S. Why the functor syntax for a nonstatic field such as Q? I'd have thought to pass it something like &myExpWaveProbReference.Q instead of &ExpWaveProb::Q, so I'm confused.


Reply With Quote


Bookmarks