Re: Luabind: derived classes!

hymedia <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <003d01c997a9$6d32e910$4798bb30$@ca>
Hi tom thx for responding,

 

That's what I thought too, but when I do:

 

myObject:AddScript(myScript); I get:

 

No matching overload found, candidates:

void AddScript(Object&,script*)

 

I m gessing that class_<Script,Object>("script") is passed instead and it is
not recognize as being a class_<LUA_Script,Script>("Script").

 

It's confusing.

 

From: Tom McCubbin [mailto:[email protected]] 
Sent: Wednesday, February 25, 2009 7:14 PM
To: [email protected]
Subject: Re: [luabind] Luabind: derived classes!

 

            class_<LUA_Script, Object>("Script")

You tell luabind LUA_Script inherits from Object.  You need to register the
Script class as deriving from Object, then register the LUA_Script as
deriving from Script.  Luabind has no way to know a LUA_Script object in C++
inherits from Script, hence the inability to find a match...try something
like:

        class_<Script,Object>("script"),
        class_<LUA_Script,Script>("Script")
        ...

That should fix you right up...hope that helped,

-tom

On Wed, 2009-02-25 at 18:01 -0500, neosettlers wrote:



        l_script = new LUA_Script();

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H

_______________________________________________
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.