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

@@ -24,11 +24,11 @@
namespace msgpack {
inline bool& operator>> (object const& o, bool& v)
inline object const& operator>> (object const& o, bool& v)
{
if(o.type != type::BOOLEAN) { throw type_error(); }
v = o.via.boolean;
return v;
return o;
}
template <typename Stream>
@@ -52,4 +52,3 @@ inline void operator<< (object::with_zone& o, bool v)
} // namespace msgpack
#endif /* msgpack/type/bool.hpp */