diff --git a/include/msgpack/v1/object.hpp b/include/msgpack/v1/object.hpp index fda54be9..e5a50e1a 100644 --- a/include/msgpack/v1/object.hpp +++ b/include/msgpack/v1/object.hpp @@ -32,11 +32,11 @@ struct object_kv { msgpack::object val; }; -struct object::with_zone : msgpack::object { - with_zone(msgpack::zone& z) : zone(z) { } +struct object_with_zone_type : msgpack::object { + object_with_zone_type(msgpack::zone& z) : zone(z) { } msgpack::zone& zone; private: - with_zone(); + object_with_zone_type(); }; diff --git a/include/msgpack/v1/object_fwd.hpp b/include/msgpack/v1/object_fwd.hpp index 951dca0e..823a22e0 100644 --- a/include/msgpack/v1/object_fwd.hpp +++ b/include/msgpack/v1/object_fwd.hpp @@ -68,6 +68,8 @@ public: #endif // !defined(MSGPACK_USE_CPP03) +struct object_with_zone_type; + /// Object class that corresponding to MessagePack format object /** * See https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_object @@ -219,7 +221,8 @@ struct object { template object& operator=(const T& v); - struct with_zone; + // Not a nested struct (i.e. 'struct with_zone;') to work around MSVC C++20 modules error C2504 + typedef object_with_zone_type with_zone; protected: struct implicit_type;