From bdd13859b60d06ec6fabdbaccea81cbee189b8bc Mon Sep 17 00:00:00 2001 From: frsyuki Date: Tue, 24 Feb 2009 16:37:47 +0900 Subject: c: msgpack_pack_object --- cpp/object.hpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'cpp/object.hpp') diff --git a/cpp/object.hpp b/cpp/object.hpp index c3f2872..b4c21f1 100644 --- a/cpp/object.hpp +++ b/cpp/object.hpp @@ -162,18 +162,6 @@ inline packer& packer::pack(const T& v) return *this; } -template -inline void pack(Stream& s, const T& v) -{ - packer(s).pack(v); -} - -template -inline void pack_copy(packer& o, T v) -{ - pack(o, v); -} - inline object& operator>> (object o, object& v) { v = o; @@ -250,6 +238,20 @@ inline void pack(packer& o, const T& v) o.pack(v); } +// obsolete +template +inline void pack(Stream& s, const T& v) +{ + packer(s).pack(v); +} + +// obsolete +template +inline void pack_copy(packer& o, T v) +{ + pack(o, v); +} + template packer& operator<< (packer& o, const object& v) @@ -309,7 +311,7 @@ packer& operator<< (packer& o, const object& v) for(object* p(v.via.array.ptr), * const pend(v.via.array.ptr + v.via.array.size); p < pend; ++p) { - *p >> o; + o << *p; } return o; // FIXME loop optimiziation @@ -319,8 +321,8 @@ packer& operator<< (packer& o, const object& v) for(object_kv* p(v.via.map.ptr), * const pend(v.via.map.ptr + v.via.map.size); p < pend; ++p) { - p->key >> o; - p->val >> o; + o << p->key; + o << p->val; } return o; // FIXME loop optimiziation -- cgit v1.2.1