1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #include <msgpack.hpp>
- #include <string>
- #include <iostream>
- #include <sstream>
- int main(void)
- {
- msgpack::type::tuple<int, bool, std::string> src(1, true, "example");
-
-
- std::stringstream buffer;
- msgpack::pack(buffer, src);
-
- buffer.seekg(0);
-
- std::string str(buffer.str());
- msgpack::object_handle oh = msgpack::unpack(str.data(), str.size());
-
- msgpack::object deserialized = oh.get();
-
- std::cout << deserialized << std::endl;
-
-
- msgpack::type::tuple<int, bool, std::string> dst;
- deserialized.convert(dst);
- return 0;
- }
|