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:
Takatoshi Kondo
2014-08-29 00:43:18 +09:00
parent 2c2df64427
commit 68bf4acb4b
27 changed files with 168 additions and 186 deletions

View File

@@ -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