13
0

luaBridge support const references to class-instance pointers

Support passing "T*" as as "const T* &"  argument
e.g. std::list<T*>::push_back ( const T* & )
This commit is contained in:
Robin Gareus 2017-02-23 22:19:19 +01:00
parent e8cebac6a3
commit 37dc93b40a

View File

@ -783,6 +783,22 @@ struct Stack <T const* const>
}
};
// const references to class-instance pointers
// e.g. std::list<T*>::push_back ( const T* & )
template <class T>
struct Stack <T* const&>
{
static inline void push (lua_State* L, T* const& p)
{
UserdataPtr::push (L, p);
}
static inline T* get (lua_State* L, int index)
{
return Userdata::get <T> (L, index, true);
}
};
// reference
template <class T>
struct Stack <T&>