I'm attempting to register several specialzed template classes, but i keep getting the error: "Error : Failed in call to function 'RegisterObjectType' with 'LLObject<ConvexHull@>' (Code: -8)" i'm registering it like so: m_ScriptEngine->RegisterObjectType("ConvexHull", sizeof(ConvexHull), asOBJ_REF|asOBJ_NOCOUNT); m_ScriptEngine->RegisterObjectType("LLObject<ConvexHull@>", 0, asOBJ_REF|asOBJ_NOCOUNT);
any tips on what i'm doing wrong?, if you need more code, i can post more, just tell me w/e u need. edit: also, i'm using AS 2.25.0
Cancel
Save
Have you registered the LLObject template first?
Cancel
Save
yes, i've tried it with declaring it as a template, before i declared the specialized class like so: m_ScriptEngine->RegisterObjectType("ConvexHull", sizeof(ConvexHull), asOBJ_REF|asOBJ_NOCOUNT); m_ScriptEngine->RegisterObjectType("LLObject<class T>", 0, asOBJ_REF|asOBJ_NOCOUNT|asOBJ_TEMPLATE); m_ScriptEngine->RegisterObjectType("LLObject<ConvexHull@>", 0, asOBJ_REF|asOBJ_NOCOUNT);
but this still results in the same error code.
Cancel
Save
It might be a bug in AngelScript when parsing the template specialization with the handle as subtype. I'll investigate it.
Cancel
Save
It might be a bug in AngelScript when parsing the template specialization with the handle as subtype. I'll investigate it. Thanks Andreas, in the meantime, I can probably come up with an alternative solution, not exactly what i'd like, but it'll have to do for now=-).
Cancel
Save
The registration was failing because the LLObject template type didn't have a default constructor, which AngelScript treated as if the template type cannot be instanciated at all. I've fixed this in revision 1424.
Cancel
Save
thanks Andreas=-), i've successfully templated several types without any complaints from the compiler so far. I'll post a response if i run into any more issues.
Cancel
Save