I've come to think of the pointers in AngelScript as a great burden that I would rather remove. I realize that in some situations they can be useful, and that some of you are already using pointers in the script. Therefore I want to ask your opinion before removing the pointers.
If it was possible I would make it a compile time option, with the default turned of (just like I've done with AS_DEPRECATED).
Instead of native pointers the application would register a special type, e.g. float_ptr. The library will also allow registration of the -> operator so that the pointer can be emulated. Another advantage of this is that the application would be able to register an indexing operator so that it could work exactly like normal C arrays.
instead of:
void function()
{
Object *obj = GetObject();
if( obj->property )
obj->Method();
}
it will be:
void function()
{
Object_ptr obj = GetObject();
if( obj->property )
obj->Method();
}
What do you think? Can I do this without disrupting your projects too much? It would really help me improve the library even further.
Let me know what you think. Please.
Regards,
Andreas