add_dependency assert problem
锋 <[email protected]> Wed, 17 Aug 2011 18:22:34 +0800
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <CAEMQFeVdH5WoFsqGVwKSzO878FUSAaxE5eA6LS+UmqLHeaoUdA@mail.gmail.com> |
hi, all:
i get *assertion* error in *object_rep*.cpp -- "assert(m_dependency_cnt <
sizeof(object_rep));" when i use luabind like this example:
----------------------
class base
{
public:
virtual void print() {} // if not use 'virtual', the
m_dependency_cnt will not bigger than sizeof(object_rep)
};
class derived : public base {};
class derived_wrap : public derived, public wrap_base {};
class holder
{
public:
base* member;
holder(base* p) : member(p) {}
};
module(L)
[
class_<base>("base")
.def(constructor<>())
.def("print", &base::print),
class_<derived, derived_wrap, base>("derived") // i want the
"derived" in lua can be derived and also have base class "print" function
.def(constructor<>()),
class_<holder>("holder")
.def(constructor<base*>())
.def_readonly("member", &holder::member)
];
luaL_dostring(L,
"a = derived() "
"b = holder(a) "
"for i = 1, 100 do "
" b.member:print() "
"end "
);
----------------------
any ideas? thanks in advance
onlyfeng
[email protected]
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user