Deriving derived classes
Steven Webb <[email protected]> Tue, 17 Jul 2012 13:36:21 +0800
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <CAJ+TB_yuzssdi3f=0z_+hWRrhdo+qS6NAy+nHjVdEp7YoSWAuQ@mail.gmail.com> |
Section 12.1 of the lua docs shows how to derive a class in lua from a c++
class using a wrapper. However, how do you do this when the base class
inherits from another class? For example, if the base class in Section 12.1
inherited from a "guitar" class, would the class_ binding look like this?
module(L)
[
class_<base, guitar, base_wrapper>("base")
.def(constructor<const char*>())
.def("f", &base::f, &base_wrapper::default_f)
];
That syntax compiles for me, but I'm occasionally getting segfaults when
calling virtual methods on the base class. I'm hoping that I'm not binding
it correctly, because the segfaults are intermittent and I'm struggling to
track it down.
Cheers.
Steve.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user