ToLua++, vectors, and lists

Started by
2 comments, last by Josh Klint 12 years, 10 months ago
Does ToLua++ support std::vectors and lists, so I can do stuff like this?:

C++:
class Entity
{
std::list<Entity*> kids
};

Lua:
local child
for child in entity.kids do
--do stuff
end

10x Faster Performance for VR: www.ultraengine.com

Advertisement
It's quite a workaround, but there appears to be a way to do this here:
http://stackoverflow.com/questions/837772/how-do-i-pass-a-list-of-objects-from-c-to-lua

10x Faster Performance for VR: www.ultraengine.com

What is the reason you want to make a copy of the std container in Lua? Is the boundary jumping causing a problem when you implement a Lua iterator for the container?
I haven't looked that closely at it yet, actually, I just came across a page that claims to have a solution. I don't know how to make a Lua iterator for a container yet, but that would certainly be preferable.

10x Faster Performance for VR: www.ultraengine.com

This topic is closed to new replies.

Advertisement