]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
json: encoding for flat_set accepts all template params
authorCasey Bodley <cbodley@redhat.com>
Wed, 3 Mar 2021 19:05:24 +0000 (14:05 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 13 Sep 2021 16:27:51 +0000 (12:27 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/ceph_json.h

index f33f293e246b0200be85dc0b665b7fab11ce8524..08e8d9e46623302cdda1d9f30d486a487aaa7bac 100644 (file)
@@ -220,8 +220,8 @@ void decode_json_obj(std::set<T>& l, JSONObj *obj)
   }
 }
 
-template<class T>
-void decode_json_obj(boost::container::flat_set<T>& l, JSONObj *obj)
+template<class T, class Compare, class Alloc>
+void decode_json_obj(boost::container::flat_set<T, Compare, Alloc>& l, JSONObj *obj)
 {
   l.clear();
 
@@ -560,9 +560,9 @@ static void encode_json(const char *name, const std::set<T, Compare>& l, ceph::F
   f->close_section();
 }
 
-template<class T, class Compare = std::less<T> >
+template<class T, class Compare, class Alloc>
 static void encode_json(const char *name,
-                        const boost::container::flat_set<T, Compare>& l,
+                        const boost::container::flat_set<T, Compare, Alloc>& l,
                         ceph::Formatter *f)
 {
   f->open_array_section(name);