Skip to content

Commit 1876bad

Browse files
authored
Merge pull request #1154 from scrossuk/cpp_master
Work around MSVC C++20 modules error for nested msgpack::object::with_zone
2 parents 800c483 + 712ec2e commit 1876bad

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

include/msgpack/v1/object.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ struct object_kv {
3232
msgpack::object val;
3333
};
3434

35-
struct object::with_zone : msgpack::object {
36-
with_zone(msgpack::zone& z) : zone(z) { }
35+
struct object_with_zone_type : msgpack::object {
36+
object_with_zone_type(msgpack::zone& z) : zone(z) { }
3737
msgpack::zone& zone;
3838
private:
39-
with_zone();
39+
object_with_zone_type();
4040
};
4141

4242

include/msgpack/v1/object_fwd.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ struct has_as {
6868

6969
#endif // !defined(MSGPACK_USE_CPP03)
7070

71+
struct object_with_zone_type;
72+
7173
/// Object class that corresponding to MessagePack format object
7274
/**
7375
* See https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_object
@@ -219,7 +221,8 @@ struct object {
219221
template <typename T>
220222
object& operator=(const T& v);
221223

222-
struct with_zone;
224+
// Not a nested struct (i.e. 'struct with_zone;') to work around MSVC C++20 modules error C2504
225+
typedef object_with_zone_type with_zone;
223226

224227
protected:
225228
struct implicit_type;

0 commit comments

Comments
 (0)