[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Issues with Lunar while using multiple lunar templated objects.
- From: Ignacio Burgueño <ignaciob@...>
- Date: Sun, 01 Nov 2009 17:25:56 -0200
Sivan Thiruvengadam wrote:
Thanks.
Let me change this by pushing the object as you suggest and see if
things work as expected.
BTW, I always hit the else part of the CLNumList constructor, since i am
not passing any CLNumList instance from LUA.
Yep, I forgot that Lunar removes 'self'.
// member function dispatcher
static int thunk(lua_State *L) {
// stack has userdata, followed by method args
T *obj = check(L, 1); // get 'self', or if you prefer, 'this'
---> lua_remove(L, 1); // remove self so member function args start
at index 1
// get member function from upvalue
RegType *l = static_cast<RegType*>(lua_touserdata(L,
lua_upvalueindex(1)));
return (obj->*(l->mfunc))(L); // call member function
}