From b59b2759f803112417ca5d1a8ba3e248ac4397c5 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 28 Jun 2018 11:04:49 +0200 Subject: [PATCH] LuaWrapper: Add support for handling specialized unordered map as tables --- ext/luawrapper/include/LuaContext.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp index fd22605c4..50fb4513e 100644 --- a/ext/luawrapper/include/LuaContext.hpp +++ b/ext/luawrapper/include/LuaContext.hpp @@ -2113,12 +2113,12 @@ struct LuaContext::Pusher> { }; // unordered_maps -template -struct LuaContext::Pusher> { +template +struct LuaContext::Pusher> { static const int minSize = 1; static const int maxSize = 1; - static PushedObject push(lua_State* state, const std::unordered_map& value) noexcept { + static PushedObject push(lua_State* state, const std::unordered_map& value) noexcept { static_assert(Pusher::type>::minSize == 1 && Pusher::type>::maxSize == 1, "Can't push multiple elements for a table key"); static_assert(Pusher::type>::minSize == 1 && Pusher::type>::maxSize == 1, "Can't push multiple elements for a table value"); @@ -2777,16 +2777,16 @@ struct LuaContext::Reader> }; // unordered_map -template -struct LuaContext::Reader> +template +struct LuaContext::Reader> { static auto read(lua_State* state, int index) - -> boost::optional> + -> boost::optional> { if (!lua_istable(state, index)) return boost::none; - std::unordered_map result; + std::unordered_map result; // we traverse the table at the top of the stack lua_pushnil(state); // first key -- 2.40.0