🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

ScriptString registration

Started by
1 comment, last by Tylon 18 years, 7 months ago
the asCScriptString class in scriptstring.cpp is registered using asOBJ_CLASS_CDA, but there is no destructor specified. Should it correctly be asOBJ_CLASS_CA, or can you just use asOBJ_CLASS_CDA globally even if you dont use some of the behaviours (construction, destruction and assignment) without any problems? I understand that the reference counting behaviours are defined, so angelscript will just use that to correctly delete the string, but still, is the asOBJ_CLASS_CDA registration parameter correct if there is no destructor specified?
Advertisement
The argument asOBJ_CLASS_CDA tells AngelScript how C++ handles the object, not what behaviours will be used by AngelScript.

It's important to tell AngelScript whether the class has constructors, destructors, or the assignment operator defined, because this changes the way C++ passes the class in parameters or the way it is returned by functions.

Regards,
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

Ok, that makes sense, thanks

This topic is closed to new replies.

Advertisement