This changes when returning value objects

Started by
10 comments, last by WitchLord 11 years ago

Oh, that is worrying. Is it possible for end user like myself know how a value type should be registered? Is there a method end users can use to deduce how it should be done in all cases?

Advertisement

Until I'm able to confirm otherwise the way to register the value types is to follow the documentation. Fortunately the case you reported is probably not that frequently occurring, and can easily be remedied by adding an explicit constructor to the class if needed.

Unfortunately the ABI is not something that is standardized. Every combination of compiler, operative system and CPU has its own ABI. With AngelScript I keep a common interface so that a type can be registered the same way on all platforms, but unfortunately the C++ language doesn't quite provide all the information needed to automatically determine how the compiler handles a type in the ABI.

The new template functions introduced with C++11 does help a bit, but it seems that they are not perfect either.

In this case the best would probably be to have some code generator that can parse the C++ code and determine the correct way to register the class that way. Some attempts to implement something like this has been done before, but I'm not sure if any of these attempts managed a perfect implementation, nor do I know of any that is maintained to this day.

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