mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-04-25 01:19:07 +02:00
Fixed #442.
Updated msgpack::v1::operator<< and >> implementation. Those functions refer to current version of convert, pack, object, and object_with_zone.
This commit is contained in:
parent
84932e62e9
commit
455e0190d1
@ -51,25 +51,25 @@ struct object_with_zone {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
inline
|
inline
|
||||||
msgpack::object const& operator>> (msgpack::object const& o, T& v) {
|
msgpack::object const& operator>> (msgpack::object const& o, T& v) {
|
||||||
return adaptor::convert<T>()(o, v);
|
return msgpack::adaptor::convert<T>()(o, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Stream, typename T>
|
template <typename Stream, typename T>
|
||||||
inline
|
inline
|
||||||
msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, T const& v) {
|
msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, T const& v) {
|
||||||
return adaptor::pack<T>()(o, v);
|
return msgpack::adaptor::pack<T>()(o, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline
|
inline
|
||||||
void operator<< (msgpack::object& o, T const& v) {
|
void operator<< (msgpack::object& o, T const& v) {
|
||||||
adaptor::object<T>()(o, v);
|
msgpack::adaptor::object<T>()(o, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline
|
inline
|
||||||
void operator<< (msgpack::object::with_zone& o, T const& v) {
|
void operator<< (msgpack::object::with_zone& o, T const& v) {
|
||||||
adaptor::object_with_zone<T>()(o, v);
|
msgpack::adaptor::object_with_zone<T>()(o, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @cond
|
/// @cond
|
||||||
|
@ -41,32 +41,6 @@ struct object_with_zone : v1::adaptor::object_with_zone<T, Enabler> {
|
|||||||
|
|
||||||
} // namespace adaptor
|
} // namespace adaptor
|
||||||
|
|
||||||
// operators
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
inline
|
|
||||||
msgpack::object const& operator>> (msgpack::object const& o, T& v) {
|
|
||||||
return adaptor::convert<T>()(o, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Stream, typename T>
|
|
||||||
inline
|
|
||||||
msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, T const& v) {
|
|
||||||
return adaptor::pack<T>()(o, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
inline
|
|
||||||
void operator<< (msgpack::object& o, T const& v) {
|
|
||||||
adaptor::object<T>()(o, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
inline
|
|
||||||
void operator<< (msgpack::object::with_zone& o, T const& v) {
|
|
||||||
adaptor::object_with_zone<T>()(o, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @cond
|
/// @cond
|
||||||
} // MSGPACK_API_VERSION_NAMESPACE(v2)
|
} // MSGPACK_API_VERSION_NAMESPACE(v2)
|
||||||
/// @endcond
|
/// @endcond
|
||||||
|
@ -40,17 +40,8 @@ struct object_with_zone;
|
|||||||
|
|
||||||
// operators
|
// operators
|
||||||
|
|
||||||
template <typename T>
|
using v1::operator>>;
|
||||||
msgpack::object const& operator>> (msgpack::object const& o, T& v);
|
using v1::operator<<;
|
||||||
|
|
||||||
template <typename Stream, typename T>
|
|
||||||
msgpack::packer<Stream>& operator<< (msgpack::packer<Stream>& o, T const& v);
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
void operator<< (msgpack::object& o, T const& v);
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
void operator<< (msgpack::object::with_zone& o, T const& v);
|
|
||||||
|
|
||||||
/// @cond
|
/// @cond
|
||||||
} // MSGPACK_API_VERSION_NAMESPACE(v2)
|
} // MSGPACK_API_VERSION_NAMESPACE(v2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user