1 parent afcaa5e commit 316e0bdCopy full SHA for 316e0bd
1 file changed
section4/msgpack.cpp
@@ -97,7 +97,11 @@ void case3()
97
msgpack::sbuffer sbuf;
98
msgpack::pack(sbuf, book1);
99
100
- auto obj = msgpack::unpack(sbuf.data(), sbuf.size()).get();
+ // may cause std::bad_cast error
101
+ //auto obj = msgpack::unpack(sbuf.data(), sbuf.size()).get();
102
+
103
+ auto handle = msgpack::unpack(sbuf.data(), sbuf.size());
104
+ auto obj = handle.get();
105
106
Book book2;
107
obj.convert(book2);
0 commit comments