From: Yehuda Sadeh Date: Mon, 3 Apr 2017 22:11:27 +0000 (-0700) Subject: common/ceph_json: map type can handle 2 or 3 template arguments X-Git-Tag: ses5-milestone6~9^2~3^2~39 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f1e681bf8334811e52d17aa287acc889fcef3dbe;p=ceph.git common/ceph_json: map type can handle 2 or 3 template arguments Signed-off-by: Yehuda Sadeh --- diff --git a/src/common/ceph_json.h b/src/common/ceph_json.h index 18cf06fd4f19..6c9e3b4174df 100644 --- a/src/common/ceph_json.h +++ b/src/common/ceph_json.h @@ -210,8 +210,8 @@ void decode_json_obj(vector& l, JSONObj *obj) } } -template -void decode_json_obj(map& m, JSONObj *obj) +template > +void decode_json_obj(map& m, JSONObj *obj) { m.clear(); @@ -384,11 +384,11 @@ static void encode_json(const char *name, const std::vector& l, ceph::Formatt f->close_section(); } -template -static void encode_json(const char *name, const std::map& m, ceph::Formatter *f) +template > +static void encode_json(const char *name, const std::map& m, ceph::Formatter *f) { f->open_array_section(name); - for (typename std::map::const_iterator i = m.begin(); i != m.end(); ++i) { + for (typename std::map::const_iterator i = m.begin(); i != m.end(); ++i) { f->open_object_section("entry"); encode_json("key", i->first, f); encode_json("val", i->second, f);