gengyong/luaaa

Binding existing objects

oschepkovdaniel opened this issue · 2 comments

Hi! The library is very useful, but what about binding existing C++ objects (instances of classes) to lua? Is there any solutions for this?

define a "ctor" for it, return the object instance. the "ctor" accept one or two functor which for alloc and free the object, if you set deleter functor as null, the object will never be GC from lua, this behavior fit for most singleton patern.