I'm using the generic wrappers and trying to use the inherited methods template example to register base class methods for derived classes. I get the following compile error when changing from asMETHOD to WRAP_MFN in the RegisterBaseMembers<> template:
error: invalid operands of types ‘<unresolved overloaded function type>’ and 'bool (MotorControl::*)()' to binary ‘operator<’
Called from:
RegisterBaseMembers<MotorControl>(engine, “MotorControl”);
In template:
template <class T> void RegisterBaseMembers(asIScriptEngine* engine, const char type)
{
r = engine→RegisterObjectMethod(type, “bool isOn()”, WRAP_MFN(T, isOn), asCALL_GENERIC);
^ // ERROR
}
But, the following template compiles fine (with asMETHOD instead of WRAP_MFN):
template <class T> void RegisterBaseMembers(asIScriptEngine* engine, const char type)
{
r = engine→RegisterObjectMethod(type, “bool isOn()”, asMETHOD(T, isOn), asCALL_THISCALL);
}
Also, if I don't use the BaseMembers template and use the RegisterObjectMethod w/WRAP_MFN explicitly everything is fine, but becomes a maintenance nightmare for derived classes. The wrapper templates are quite complex and I'm guessing there is something about the WRAP_MFN template that is not defined when used in the RegisterBaseMembers template.
AngelScript 2.35.0 WIP
g++ 7.3.0 on Ubuntu 18.4