From ab12b2b2b98df96f2103de02c767d79c1f636449 Mon Sep 17 00:00:00 2001 From: Jakob Petsovits Date: Fri, 19 Sep 2014 22:08:59 -0400 Subject: [PATCH] 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. --- src/msgpack/object.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/msgpack/object.hpp b/src/msgpack/object.hpp index 76fe4cae..665e1e19 100644 --- a/src/msgpack/object.hpp +++ b/src/msgpack/object.hpp @@ -412,6 +412,12 @@ packer& operator<< (packer& o, const object& v) } } +template +packer& operator<< (packer& o, const object::with_zone& v) +{ + return o << static_cast(v); +} + } // namespace msgpack