Hi, is it possible to register a (generic) STL Container to Lua, such as std::vector<>? I've registered some C++ types as usertypes and some of them return std:vector<>& of different types. But they are only exposed as usertype, not as table - so I cannot iterate them.
Is there a solution on this or is it not possible, yet?
All types which contain a begin() and end() that are iterators are automatically pushed as tables into Lua. This includes vector, map, unordered_map, list, deque, BASICALLY every std:: container ever.
Albeit, now that you've mentioned this I am envisioning a bug with returning a reference to a vector and reference semantics being applied internally, making it push a userdata instead of the table semantics I just described.
... Oops. I'll fix that right away.
https://github.com/ThePhD/sol2/releases
Enjooooy.
Awesome!!