How to use STL in angelscript?,
Members - Reputation: 122
Posted 06 July 2004 - 06:50 PM
Moderators - Reputation: 4408
Posted 07 July 2004 - 01:26 AM
Really, I recognize the work needed to register every possible type of array. I have some ideas for how to implement good support for arrays which ought to be quite easy to use. However it requires a lot of work and there are other things that I judge more important.
I'm not sure why your application throws an exception, it looks like you're registering the methods correctly. Maybe STL is using a calling convention other than __thiscall? Maybe you could resolve the problem with a wrapper function? Like so:
void vector_push_back(int val, vector<int> *vec)
engine->RegisterObjectMethod("vector", "void push_back(int)", asFUNCTION(vector_push_back), asCALL_CDECL_OBJLAST);
If it is a problem with differing calling conventions this should resolve it. Though it can be quite tedious to write the wrapper functions for all methods and types.
All I can say at the moment is that I will improve the support for this. The time for this improvement is at least 2 months away though.
I hope you will not be forced to abandon AngelScript because of this. If you should go with another scripting library, I hope you'll still keep an eye on AngelScript. You can be sure that it will improve over time.
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game