Skip to content

Commit 316e0bd

Browse files
committed
msgpack.cpp
1 parent afcaa5e commit 316e0bd

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

section4/msgpack.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ void case3()
9797
msgpack::sbuffer sbuf;
9898
msgpack::pack(sbuf, book1);
9999

100-
auto obj = msgpack::unpack(sbuf.data(), sbuf.size()).get();
100+
// 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();
101105

102106
Book book2;
103107
obj.convert(book2);

0 commit comments

Comments
 (0)