Sign in to follow this  
JoshKlint_34394

ToLua++, vectors, and lists

Recommended Posts

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this