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:
Jakob Petsovits
2014-09-19 22:08:59 -04:00
parent 7ce69a362f
commit ab12b2b2b9

View File

@@ -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 } // namespace msgpack