Add msgpack prefix to type_errors

This commit is contained in:
Nobuyuki Kubota 2015-03-10 20:59:34 +09:00
parent 4b0c90fc90
commit b0ff2802d2
27 changed files with 142 additions and 142 deletions

View File

@ -28,7 +28,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
inline msgpack::object const& operator>> (msgpack::object const& o, bool& v)
{
if(o.type != msgpack::type::BOOLEAN) { throw type_error(); }
if(o.type != msgpack::type::BOOLEAN) { throw msgpack::type_error(); }
v = o.via.boolean;
return o;
}

View File

@ -31,8 +31,8 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
template <typename T, std::size_t N>
inline msgpack::object const& operator>> (msgpack::object const& o, std::array<T, N>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size != N) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size != N) { throw msgpack::type_error(); }
if(o.via.array.size > 0) {
msgpack::object* p = o.via.array.ptr;
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;

View File

@ -33,15 +33,15 @@ inline msgpack::object const& operator>> (msgpack::object const& o, std::array<c
{
switch (o.type) {
case msgpack::type::BIN:
if(o.via.bin.size != N) { throw type_error(); }
if(o.via.bin.size != N) { throw msgpack::type_error(); }
std::memcpy(v.data(), o.via.bin.ptr, o.via.bin.size);
break;
case msgpack::type::STR:
if(o.via.str.size != N) { throw type_error(); }
if(o.via.str.size != N) { throw msgpack::type_error(); }
std::memcpy(v.data(), o.via.str.ptr, N);
break;
default:
throw type_error();
throw msgpack::type_error();
break;
}
return o;

View File

@ -32,7 +32,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
template <typename T>
inline msgpack::object const& operator>> (msgpack::object const& o, std::forward_list<T>& v)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
v.resize(o.via.array.size);
msgpack::object* p = o.via.array.ptr;
for (auto &e : v) {

View File

@ -100,8 +100,8 @@ template <typename... Args>
inline msgpack::object const& operator>> (
msgpack::object const& o,
std::tuple<Args...>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < sizeof...(Args)) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < sizeof...(Args)) { throw msgpack::type_error(); }
StdTupleConverter<decltype(v), sizeof...(Args)>::convert(o, v);
return o;
}

View File

@ -31,7 +31,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
template <typename K, typename V>
inline msgpack::object const& operator>> (msgpack::object const& o, std::unordered_map<K, V>& v)
{
if(o.type != msgpack::type::MAP) { throw type_error(); }
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
msgpack::object_kv* p(o.via.map.ptr);
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
std::unordered_map<K, V> tmp;
@ -84,7 +84,7 @@ inline void operator<< (msgpack::object::with_zone& o, const std::unordered_map<
template <typename K, typename V>
inline msgpack::object const& operator>> (msgpack::object const& o, std::unordered_multimap<K, V>& v)
{
if(o.type != msgpack::type::MAP) { throw type_error(); }
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
msgpack::object_kv* p(o.via.map.ptr);
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
std::unordered_multimap<K, V> tmp;

View File

@ -31,7 +31,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
template <typename T>
inline msgpack::object const& operator>> (msgpack::object const& o, std::unordered_set<T>& v)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
msgpack::object* p = o.via.array.ptr + o.via.array.size;
msgpack::object* const pbegin = o.via.array.ptr;
std::unordered_set<T> tmp;
@ -81,7 +81,7 @@ inline void operator<< (msgpack::object::with_zone& o, const std::unordered_set<
template <typename T>
inline msgpack::object const& operator>> (msgpack::object const& o, std::unordered_multiset<T>& v)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
msgpack::object* p = o.via.array.ptr + o.via.array.size;
msgpack::object* const pbegin = o.via.array.ptr;
std::unordered_multiset<T> tmp;

View File

@ -31,7 +31,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
template <typename T>
inline msgpack::object const& operator>> (msgpack::object const& o, std::deque<T>& v)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
v.resize(o.via.array.size);
msgpack::object* p = o.via.array.ptr;
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;

View File

@ -90,7 +90,7 @@ struct define<> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
}
void msgpack_object(msgpack::object* o, msgpack::zone&) const
{
@ -115,7 +115,7 @@ struct define<A0> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -153,7 +153,7 @@ struct define<A0, A1> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -195,7 +195,7 @@ struct define<A0, A1, A2> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -241,7 +241,7 @@ struct define<A0, A1, A2, A3> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -291,7 +291,7 @@ struct define<A0, A1, A2, A3, A4> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -345,7 +345,7 @@ struct define<A0, A1, A2, A3, A4, A5> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -403,7 +403,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -465,7 +465,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -531,7 +531,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -601,7 +601,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -675,7 +675,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -753,7 +753,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -835,7 +835,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -921,7 +921,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -1011,7 +1011,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -1105,7 +1105,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -1203,7 +1203,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -1305,7 +1305,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -1411,7 +1411,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -1521,7 +1521,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -1635,7 +1635,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -1753,7 +1753,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -1875,7 +1875,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -2001,7 +2001,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -2131,7 +2131,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -2265,7 +2265,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -2403,7 +2403,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -2545,7 +2545,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -2691,7 +2691,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -2841,7 +2841,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -2995,7 +2995,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;
@ -3153,7 +3153,7 @@ struct define<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
const size_t size = o.via.array.size;
if(size > 0) {
msgpack::object *ptr = o.via.array.ptr;

View File

@ -10586,7 +10586,7 @@ inline tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A1
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<>&) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
return o;
}
@ -10594,8 +10594,8 @@ template <typename A0>
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 1) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 1) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
return o;
@ -10605,8 +10605,8 @@ template <typename A0, typename A1>
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 2) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 2) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10617,8 +10617,8 @@ template <typename A0, typename A1, typename A2>
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 3) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 3) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10630,8 +10630,8 @@ template <typename A0, typename A1, typename A2, typename A3>
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 4) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 4) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10644,8 +10644,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4>
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 5) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 5) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10659,8 +10659,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 6) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 6) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10675,8 +10675,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 7) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 7) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10692,8 +10692,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 8) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 8) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10710,8 +10710,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 9) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 9) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10729,8 +10729,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 10) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 10) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10749,8 +10749,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 11) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 11) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10770,8 +10770,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 12) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 12) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10792,8 +10792,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 13) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 13) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10815,8 +10815,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 14) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 14) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10839,8 +10839,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 15) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 15) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10864,8 +10864,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 16) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 16) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10890,8 +10890,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 17) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 17) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10917,8 +10917,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 18) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 18) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10945,8 +10945,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 19) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 19) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -10974,8 +10974,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 20) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 20) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -11004,8 +11004,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 21) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 21) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -11035,8 +11035,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 22) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 22) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -11067,8 +11067,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 23) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 23) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -11100,8 +11100,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 24) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 24) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -11134,8 +11134,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 25) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 25) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -11169,8 +11169,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 26) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 26) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -11205,8 +11205,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 27) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 27) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -11242,8 +11242,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 28) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 28) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -11280,8 +11280,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 29) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 29) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -11319,8 +11319,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 30) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 30) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -11359,8 +11359,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 31) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 31) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());
@ -11400,8 +11400,8 @@ template <typename A0, typename A1, typename A2, typename A3, typename A4, typen
inline msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30, A31>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < 32) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size < 32) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert<typename type::tuple_type<A0>::type>(v.template get<0>());
o.via.array.ptr[1].convert<typename type::tuple_type<A1>::type>(v.template get<1>());

View File

@ -129,7 +129,7 @@ struct define {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
define_imp<std::tuple<Args&...>, sizeof...(Args)>::unpack(o, a);
}
@ -156,7 +156,7 @@ struct define<> {
}
void msgpack_unpack(msgpack::object const& o)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
}
void msgpack_object(msgpack::object* o, msgpack::zone&) const
{

View File

@ -161,8 +161,8 @@ template <typename... Args>
msgpack::object const& operator>> (
msgpack::object const& o,
type::tuple<Args...>& v) {
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size < sizeof...(Args)) { throw type_error(); }
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;
}

View File

@ -41,7 +41,7 @@ inline msgpack::object const& operator>> (msgpack::object const& o, float& v)
v = static_cast<float>(o.via.i64);
}
else {
throw type_error();
throw msgpack::type_error();
}
return o;
}
@ -66,7 +66,7 @@ inline msgpack::object const& operator>> (msgpack::object const& o, double& v)
v = static_cast<double>(o.via.i64);
}
else {
throw type_error();
throw msgpack::type_error();
}
return o;
}

View File

@ -36,14 +36,14 @@ namespace detail {
static inline T convert(msgpack::object const& o) {
if(o.type == msgpack::type::POSITIVE_INTEGER) {
if(o.via.u64 > static_cast<uint64_t>(std::numeric_limits<T>::max()))
{ throw type_error(); }
{ throw msgpack::type_error(); }
return static_cast<T>(o.via.u64);
} else if(o.type == msgpack::type::NEGATIVE_INTEGER) {
if(o.via.i64 < static_cast<int64_t>(std::numeric_limits<T>::min()))
{ throw type_error(); }
{ throw msgpack::type_error(); }
return static_cast<T>(o.via.i64);
}
throw type_error();
throw msgpack::type_error();
}
};
@ -52,10 +52,10 @@ namespace detail {
static inline T convert(msgpack::object const& o) {
if(o.type == msgpack::type::POSITIVE_INTEGER) {
if(o.via.u64 > static_cast<uint64_t>(std::numeric_limits<T>::max()))
{ throw type_error(); }
{ throw msgpack::type_error(); }
return static_cast<T>(o.via.u64);
}
throw type_error();
throw msgpack::type_error();
}
};

View File

@ -31,7 +31,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
template <typename T>
inline msgpack::object const& operator>> (msgpack::object const& o, std::list<T>& v)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
v.resize(o.via.array.size);
msgpack::object* p = o.via.array.ptr;
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;

View File

@ -49,7 +49,7 @@ namespace detail {
template <typename K, typename V>
inline msgpack::object const& operator>> (msgpack::object const& o, type::assoc_vector<K,V>& v)
{
if(o.type != msgpack::type::MAP) { throw type_error(); }
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
v.resize(o.via.map.size);
msgpack::object_kv* p = o.via.map.ptr;
msgpack::object_kv* const pend = o.via.map.ptr + o.via.map.size;
@ -102,7 +102,7 @@ inline void operator<< (msgpack::object::with_zone& o, const type::assoc_vector<
template <typename K, typename V>
inline msgpack::object const& operator>> (msgpack::object const& o, std::map<K, V>& v)
{
if(o.type != msgpack::type::MAP) { throw type_error(); }
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
msgpack::object_kv* p(o.via.map.ptr);
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
std::map<K, V> tmp;
@ -162,7 +162,7 @@ inline void operator<< (msgpack::object::with_zone& o, const std::map<K,V>& v)
template <typename K, typename V>
inline msgpack::object const& operator>> (msgpack::object const& o, std::multimap<K, V>& v)
{
if(o.type != msgpack::type::MAP) { throw type_error(); }
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
msgpack::object_kv* p(o.via.map.ptr);
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
std::multimap<K, V> tmp;

View File

@ -34,7 +34,7 @@ struct nil { };
inline msgpack::object const& operator>> (msgpack::object const& o, type::nil&)
{
if(o.type != msgpack::type::NIL) { throw type_error(); }
if(o.type != msgpack::type::NIL) { throw msgpack::type_error(); }
return o;
}

View File

@ -29,8 +29,8 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
template <typename T1, typename T2>
inline msgpack::object const& operator>> (msgpack::object const& o, std::pair<T1, T2>& v)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.via.array.size != 2) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if(o.via.array.size != 2) { throw msgpack::type_error(); }
o.via.array.ptr[0].convert(v.first);
o.via.array.ptr[1].convert(v.second);
return o;

View File

@ -66,7 +66,7 @@ struct raw_ref {
inline msgpack::object const& operator>> (msgpack::object const& o, msgpack::type::raw_ref& v)
{
if(o.type != msgpack::type::BIN) { throw type_error(); }
if(o.type != msgpack::type::BIN) { throw msgpack::type_error(); }
v.ptr = o.via.bin.ptr;
v.size = o.via.bin.size;
return o;

View File

@ -31,7 +31,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
template <typename T>
inline msgpack::object const& operator>> (msgpack::object const& o, std::set<T>& v)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
msgpack::object* p = o.via.array.ptr + o.via.array.size;
msgpack::object* const pbegin = o.via.array.ptr;
std::set<T> tmp;
@ -81,7 +81,7 @@ inline void operator<< (msgpack::object::with_zone& o, const std::set<T>& v)
template <typename T>
inline msgpack::object const& operator>> (msgpack::object const& o, std::multiset<T>& v)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
msgpack::object* p = o.via.array.ptr + o.via.array.size;
msgpack::object* const pbegin = o.via.array.ptr;
std::multiset<T> tmp;

View File

@ -38,7 +38,7 @@ inline msgpack::object const& operator>> (msgpack::object const& o, std::string&
v.assign(o.via.str.ptr, o.via.str.size);
break;
default:
throw type_error();
throw msgpack::type_error();
break;
}
return o;

View File

@ -50,7 +50,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
template <typename K, typename V>
inline msgpack::object const& operator>> (msgpack::object const& o, MSGPACK_STD_TR1::unordered_map<K, V>& v)
{
if(o.type != msgpack::type::MAP) { throw type_error(); }
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
msgpack::object_kv* p(o.via.map.ptr);
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
MSGPACK_STD_TR1::unordered_map<K, V> tmp;
@ -103,7 +103,7 @@ inline void operator<< (msgpack::object::with_zone& o, const MSGPACK_STD_TR1::un
template <typename K, typename V>
inline msgpack::object const& operator>> (msgpack::object const& o, MSGPACK_STD_TR1::unordered_multimap<K, V>& v)
{
if(o.type != msgpack::type::MAP) { throw type_error(); }
if(o.type != msgpack::type::MAP) { throw msgpack::type_error(); }
msgpack::object_kv* p(o.via.map.ptr);
msgpack::object_kv* const pend(o.via.map.ptr + o.via.map.size);
MSGPACK_STD_TR1::unordered_multimap<K, V> tmp;

View File

@ -50,7 +50,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
template <typename T>
inline msgpack::object const& operator>> (msgpack::object const& o, MSGPACK_STD_TR1::unordered_set<T>& v)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
msgpack::object* p = o.via.array.ptr + o.via.array.size;
msgpack::object* const pbegin = o.via.array.ptr;
MSGPACK_STD_TR1::unordered_set<T> tmp;
@ -100,7 +100,7 @@ inline void operator<< (msgpack::object::with_zone& o, const MSGPACK_STD_TR1::un
template <typename T>
inline msgpack::object const& operator>> (msgpack::object const& o, MSGPACK_STD_TR1::unordered_multiset<T>& v)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
msgpack::object* p = o.via.array.ptr + o.via.array.size;
msgpack::object* const pbegin = o.via.array.ptr;
MSGPACK_STD_TR1::unordered_multiset<T> tmp;

View File

@ -31,7 +31,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
template <typename T>
inline msgpack::object const& operator>> (msgpack::object const& o, std::vector<T>& v)
{
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
v.resize(o.via.array.size);
if(o.via.array.size > 0) {
msgpack::object* p = o.via.array.ptr;

View File

@ -28,7 +28,7 @@ MSGPACK_API_VERSION_NAMESPACE(v1) {
inline msgpack::object const& operator>> (msgpack::object const& o, std::vector<bool>& v)
{
if (o.type != msgpack::type::ARRAY) { throw type_error(); }
if (o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
if (o.via.array.size > 0) {
v.resize(o.via.array.size);
msgpack::object* p = o.via.array.ptr;

View File

@ -40,7 +40,7 @@ inline msgpack::object const& operator>> (msgpack::object const& o, std::vector<
std::memcpy(&v.front(), o.via.str.ptr, o.via.str.size);
break;
default:
throw type_error();
throw msgpack::type_error();
break;
}
return o;

View File

@ -630,7 +630,7 @@ inline msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, const ms
return o;
default:
throw type_error();
throw msgpack::type_error();
}
}