diff --git a/sol/stack.hpp b/sol/stack.hpp index d7029bc5..4ecc0ede 100644 --- a/sol/stack.hpp +++ b/sol/stack.hpp @@ -178,6 +178,16 @@ struct pusher { lua_settable(L, -3); } } + + template, has_key_value_pair> = 0> + static void push(lua_State* L, const T& cont) { + lua_createtable(L, cont.size(), 0); + for(auto&& pair : cont) { + pusher>::push(L, pair.first); + pusher>::push(L, pair.second); + lua_settable(L, -3); + } + } }; template<>