Example

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Example

Josh Klint

Here's another example. The printed output, with one child in the entity kids, is:
No Name
Joe
No Name

"name" is not a C++ class member.

It seems a new luabind::object is created each time a C++ object is returned from a function?

        for child in self.kids do
                if child.name==nil then
                        Print("No Name")
                        child.name="Joe"
                        Print(child.name)
                else
                        Print(child.name)
                end
        end

        for child in self.kids do
                if child.name==nil then
                        print("No Name")
                else
                        Print(child.name)
                end
        end

 

I would expect the output to be:
No Name

Joe

Joe

 

 

 

Best Regards,

 

Josh Klint

CEO

Leadwerks Software

www.leadwerks.com

 


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user