AngelScript
Loading...
Searching...
No Matches
Template functions

Template functions can be implemented with the generic calling convention and registered with the engine either as global functions or as class methods.

Once the template function is called, the function can determine the type of the arguments using the asIScriptGeneric::GetArgTypeId, or alternatively with asIScriptFunction::GetSubTypeId.

// Register a global template function
r = engine->RegisterGlobalFunction("T Test<T, U>(T t, U u)", asFUNCTION(ScriptTestGen), asCALL_GENERIC); assert( r >= 0 );
@ asCALL_GENERIC
A function using the generic calling convention.
#define asFUNCTION(f)
Returns an asSFuncPtr representing the function specified by the name.