Hello,
what is the current best practice to interact with STL-Containers inside a script? E.g. if I have a C++ function “std::vector<Entity> GetObjectsInArea()”, how can it be used in AS?
I found nothing about this in the documentation. There is an addon for std::strings, which works very well, but nothing for other containers. There is however the CScriptArray, but this means, I have to copy my vector into a new CScriptArray each time I want to pass it to a script, plus this can be inefficient, since apparently, the Array stores pointers to each value, so a vector<int> can't be copied in one step using something like memcpy.
Additionally, there are few examples of how to use this class and especially the documentation about memory management is not quite clear to me. If I create a new Array and pass it to a script-function, at which point will it be deleted?
Since working with containers is such an omnipresent task, I think the documentation should at least contain an extensive ‘best practise’ guide to it, better yet, direct support by AngelScript would be awesome!