Example

"Josh Klint" <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <000201cc1783$df839940$9e8acbc0$@com>
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.