mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-21 15:51:44 +02:00
Fixed operator>>(object const& o, various types& v) return type and value problem.
https://github.com/msgpack/msgpack-c/issues/105
This commit is contained in:
@@ -140,13 +140,13 @@ struct MsgpackTupleConverter<Tuple, 1> {
|
||||
};
|
||||
|
||||
template <typename... Args>
|
||||
type::tuple<Args...>& operator>> (
|
||||
object const& operator>> (
|
||||
object const& o,
|
||||
type::tuple<Args...>& v) {
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
if(o.via.array.size < sizeof...(Args)) { throw type_error(); }
|
||||
MsgpackTupleConverter<decltype(v), sizeof...(Args)>::convert(o, v);
|
||||
return v;
|
||||
return o;
|
||||
}
|
||||
|
||||
// --- Convert from tuple to object with zone ---
|
||||
@@ -182,4 +182,3 @@ inline void operator<< (
|
||||
} // msgpack
|
||||
|
||||
#endif // MSGPACK_CPP11_MSGPACK_TUPLE_HPP
|
||||
|
||||
|
Reference in New Issue
Block a user