diff options
Diffstat (limited to 'libs/lua/LuaBridge/detail/CFunctions.h')
-rw-r--r-- | libs/lua/LuaBridge/detail/CFunctions.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/lua/LuaBridge/detail/CFunctions.h b/libs/lua/LuaBridge/detail/CFunctions.h index 22dc115a6a..88c30fc4ad 100644 --- a/libs/lua/LuaBridge/detail/CFunctions.h +++ b/libs/lua/LuaBridge/detail/CFunctions.h @@ -1148,6 +1148,17 @@ struct CFunc if (!t) { return luaL_error (L, "cannot derefencee shared_ptr"); } return tableToListHelper<T, C> (L, t->get()); } + //-------------------------------------------------------------------------- + + + template <class T, class C> + static int vectorToArray (lua_State *L) + { + C * const t = Userdata::get<C> (L, 1, false); + T * a = &((*t)[0]); + Stack <T*>::push (L, a); + return 1; + } //-------------------------------------------------------------------------- template <class T, class C> |