Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 16874

compile problems using generic wrapper templates with inherited method templates

$
0
0

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 …

Viewing all articles
Browse latest Browse all 16874

Latest Images

Trending Articles



Latest Images