Let the compiler deduce the type

It also provides a consistent coding style with the rest of C++11
examples.
This commit is contained in:
Murat Kilivan 2020-09-14 09:06:47 +01:00
parent 555cd3ff68
commit b9d06fe207

View File

@ -25,8 +25,9 @@ void array() {
std::stringstream ss;
msgpack::pack(ss, a);
msgpack::object_handle oh = msgpack::unpack(ss.str().data(), ss.str().size());
msgpack::object obj = oh.get();
auto const& str = ss.str();
auto oh = msgpack::unpack(str.data(), str.size());
auto obj = oh.get();
std::cout << obj << std::endl;
assert((obj.as<std::array<int, 5>>()) == a);