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:
parent
e8cebac6a3
commit
37dc93b40a
@ -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
|
// reference
|
||||||
template <class T>
|
template <class T>
|
||||||
struct Stack <T&>
|
struct Stack <T&>
|
||||||
|
Loading…
Reference in New Issue
Block a user