Advertisement

Template Specialization Subtypes

Started by April 30, 2014 06:02 PM
3 comments, last by WitchLord 10 years, 6 months ago

as_objecttype.cpp(369):


// interface
int asCObjectType::GetSubTypeId(asUINT subtypeIndex) const
{
    if( flags & asOBJ_TEMPLATE )
    {
        if( subtypeIndex >= templateSubTypes.GetLength() )
            return asINVALID_ARG;

        return engine->GetTypeIdFromDataType(templateSubTypes[subtypeIndex]);
    }

    // Only template types have sub types
    return asERROR;
}

If the type is a specialization of a template, the asOBJ_TEMPLATE flag is not set

http://www.angelcode.com/angelscript/sdk/docs/manual/doc_adv_template.html#doc_adv_template_2

The templateSubTypes array does have elements though. Should the search through that array really be guarded by asOBJ_TEMPLATE?

I'll look into it. Thanks for bringing it up.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

I've corrected this in revision 1928.

Thanks,

Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Is there a reason you did change asCObjectType::GetSubType as well?

No reason. I just forgot about it :)

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement