lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Maybe I'm misunderstanding something, but as stated, the function is not static, and can't be registered with Lua anyway.  As with other non-static methods, you need to create (or auto-generate in some way) a wrapper function that is static, which can in some manner access the instance, such as through a Lua upvalueindex or userdata argument on the stack, in order to call the instance method with an object.

On Jan 6, 2008, at 11:51 PM, Panagiotis Vossos wrote:

While experimenting with stl binders yesterday, I had the following
problem.  Let's say we have a
derived from std::unary_function c++ struct with the method:
int operator()(lua_State *L) const { ... }.

Is there any easy way to make it available to lua as a normal function?

thanks in advance,
panagiotis.

Be seeing you

grrr waaa
www.grahamwakefield.net