@@ -31,11 +31,11 @@ int main(void) {
3131 msgpack::pack(sbuf, vec);
3232
3333 // deserialize it.
34- msgpack::unpacked msg;
35- msgpack::unpack(&msg, sbuf.data(), sbuf.size());
34+ msgpack::object_handle oh =
35+ msgpack::unpack(sbuf.data(), sbuf.size());
3636
3737 // print the deserialized object.
38- msgpack::object obj = msg .get();
38+ msgpack::object obj = oh .get();
3939 std::cout << obj << std::endl; //=> ["Hello", "MessagePack"]
4040
4141 // convert it into statically typed object.
@@ -79,9 +79,9 @@ int main(void) {
7979 pac.buffer_consumed(buffer.size());
8080
8181 // now starts streaming deserialization.
82- msgpack::unpacked result ;
83- while(pac.next(&result )) {
84- std::cout << result .get() << std::endl;
82+ msgpack::object_handle oh ;
83+ while(pac.next(&oh )) {
84+ std::cout << oh .get() << std::endl;
8585 }
8686
8787 // results:
@@ -151,10 +151,10 @@ int main(void) {
151151 msgpack::sbuffer sbuf;
152152 msgpack::pack(sbuf, vec);
153153
154- msgpack::unpacked msg;
155- msgpack::unpack(&msg, sbuf.data(), sbuf.size());
154+ msgpack::object_handle oh =
155+ msgpack::unpack(sbuf.data(), sbuf.size());
156156
157- msgpack::object obj = msg .get();
157+ msgpack::object obj = oh .get();
158158
159159 // you can convert object to myclass directly
160160 std::vector<myclass> rvec;
0 commit comments