diff --git a/src/data/dynamic.hpp b/src/data/dynamic.hpp index 190fc25a..e1a019dd 100644 --- a/src/data/dynamic.hpp +++ b/src/data/dynamic.hpp @@ -21,8 +21,12 @@ namespace dynamic { using Map_sptr = std::shared_ptr; using List_sptr = std::shared_ptr; + struct none {}; + + inline constexpr none NONE = {}; + using Value = std::variant< - std::monostate, + none, Map_sptr, List_sptr, std::string, diff --git a/src/logic/scripting/lua/LuaState.cpp b/src/logic/scripting/lua/LuaState.cpp index 091781b4..df24d65c 100644 --- a/src/logic/scripting/lua/LuaState.cpp +++ b/src/logic/scripting/lua/LuaState.cpp @@ -309,7 +309,7 @@ dynamic::Value lua::LuaState::tovalue(int idx) { switch (type) { case LUA_TNIL: case LUA_TNONE: - return std::monostate(); + return dynamic::NONE; case LUA_TBOOLEAN: return lua_toboolean(L, idx) == 1; case LUA_TNUMBER: {