mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-22 08:02:08 +02:00
Added converting support for different size tuples.
This commit is contained in:
@@ -150,7 +150,6 @@ struct as<msgpack::type::tuple<Args...>, typename std::enable_if<msgpack::all_of
|
||||
msgpack::type::tuple<Args...> operator()(
|
||||
msgpack::object const& o) const {
|
||||
if (o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
|
||||
if (o.via.array.size > sizeof...(Args)) { throw msgpack::type_error(); }
|
||||
return MsgpackTupleAs<Args...>::as(o);
|
||||
}
|
||||
};
|
||||
@@ -161,7 +160,6 @@ struct convert<msgpack::type::tuple<Args...>> {
|
||||
msgpack::object const& o,
|
||||
msgpack::type::tuple<Args...>& v) const {
|
||||
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
|
||||
if(o.via.array.size > sizeof...(Args)) { throw msgpack::type_error(); }
|
||||
MsgpackTupleConverter<decltype(v), sizeof...(Args)>::convert(o, v);
|
||||
return o;
|
||||
}
|
||||
|
Reference in New Issue
Block a user