• Advertisement
Sign in to follow this  

registering specialized template class?

This topic is 1932 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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:

[code]
m_ScriptEngine->RegisterObjectType("ConvexHull", sizeof(ConvexHull), asOBJ_REF|asOBJ_NOCOUNT);
m_ScriptEngine->RegisterObjectType("LLObject<ConvexHull@>", 0, asOBJ_REF|asOBJ_NOCOUNT);
[/code]

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 Edited by slicer4ever

Share this post


Link to post
Share on other sites
Advertisement
yes, i've tried it with declaring it as a template, before i declared the specialized class like so:

[code]
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);
[/code]

but this still results in the same error code. Edited by slicer4ever

Share this post


Link to post
Share on other sites
[quote name='Andreas Jonsson' timestamp='1349400519' post='4986979']
It might be a bug in AngelScript when parsing the template specialization with the handle as subtype. I'll investigate it.
[/quote]

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=-).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement