};
// unordered_maps
-template<typename TKey, typename TValue>
-struct LuaContext::Pusher<std::unordered_map<TKey,TValue>> {
+template<typename TKey, typename TValue, typename THash, typename TKeyEqual>
+struct LuaContext::Pusher<std::unordered_map<TKey,TValue,THash,TKeyEqual>> {
static const int minSize = 1;
static const int maxSize = 1;
- static PushedObject push(lua_State* state, const std::unordered_map<TKey,TValue>& value) noexcept {
+ static PushedObject push(lua_State* state, const std::unordered_map<TKey,TValue,THash,TKeyEqual>& value) noexcept {
static_assert(Pusher<typename std::decay<TKey>::type>::minSize == 1 && Pusher<typename std::decay<TKey>::type>::maxSize == 1, "Can't push multiple elements for a table key");
static_assert(Pusher<typename std::decay<TValue>::type>::minSize == 1 && Pusher<typename std::decay<TValue>::type>::maxSize == 1, "Can't push multiple elements for a table value");
};
// unordered_map
-template<typename TKey, typename TValue>
-struct LuaContext::Reader<std::unordered_map<TKey,TValue>>
+template<typename TKey, typename TValue, typename THash, typename TKeyEqual>
+struct LuaContext::Reader<std::unordered_map<TKey,TValue,THash,TKeyEqual>>
{
static auto read(lua_State* state, int index)
- -> boost::optional<std::unordered_map<TKey,TValue>>
+ -> boost::optional<std::unordered_map<TKey,TValue,THash,TKeyEqual>>
{
if (!lua_istable(state, index))
return boost::none;
- std::unordered_map<TKey,TValue> result;
+ std::unordered_map<TKey,TValue,THash,TKeyEqual> result;
// we traverse the table at the top of the stack
lua_pushnil(state); // first key