fix GCC 11 compiler/libstdc++ error

GCC 11's C++ stdlib does a weird maneuver here where it needs to know
the size of the std::pair<>::second's type. So we wrap it in a ptr.
This commit is contained in:
Lion Kortlepel
2026-04-19 21:16:43 +00:00
parent 7c6acfdc86
commit 57fe7cb055
4 changed files with 56 additions and 48 deletions
+6 -1
View File
@@ -21,13 +21,18 @@
#include "Common.h"
#include <condition_variable>
#include <string>
#include <memory>
#include <sol/sol.hpp>
using TLuaStateId = std::string;
struct TDetachedLuaValue {
using Ptr = std::shared_ptr<TDetachedLuaValue>;
using Array = std::vector<TDetachedLuaValue>;
using Object = std::unordered_map<std::string, TDetachedLuaValue>;
// This weird Ptr indirection is needed because some implementations of libstc++,
// like the GCC 11 one shipped with ubuntu 22.04, need to know the size of the second
// member of the pairs that make up the elements of such a map. It's fine in vector.
using Object = std::unordered_map<std::string, TDetachedLuaValue::Ptr>;
std::variant<std::monostate, bool, double, int, std::string, Array, Object> V;
};
std::ostream& operator<<(std::ostream& os, const TDetachedLuaValue& value);