Skip to content

Commit 65938a9

Browse files
authored
Merge pull request #916 from mkilivan/cpp_master
Let the compiler deduce the type
2 parents 555cd3f + b9d06fe commit 65938a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

example/cpp11/container.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ void array() {
2525
std::stringstream ss;
2626
msgpack::pack(ss, a);
2727

28-
msgpack::object_handle oh = msgpack::unpack(ss.str().data(), ss.str().size());
29-
msgpack::object obj = oh.get();
28+
auto const& str = ss.str();
29+
auto oh = msgpack::unpack(str.data(), str.size());
30+
auto obj = oh.get();
3031

3132
std::cout << obj << std::endl;
3233
assert((obj.as<std::array<int, 5>>()) == a);

0 commit comments

Comments
 (0)