mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-16 18:56:54 +02:00
Specialize operator<<(packer, T) also for object::with_zone.
It already existed for T = object, but if trying to pass an object::with_zone it would match the generic operator<<() instead. That operator calls o.msgpack_pack(), which doesn't exist and causes a compile error. (Re-)Using the overload for object is a better way to handle this.
This commit is contained in:
@@ -412,6 +412,12 @@ packer<Stream>& operator<< (packer<Stream>& o, const object& v)
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Stream>
|
||||
packer<Stream>& operator<< (packer<Stream>& o, const object::with_zone& v)
|
||||
{
|
||||
return o << static_cast<object>(v);
|
||||
}
|
||||
|
||||
|
||||
} // namespace msgpack
|
||||
|
||||
|
Reference in New Issue
Block a user