]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
include/types: operator<< for set with comparator
authorSage Weil <sage@redhat.com>
Wed, 22 Jul 2015 15:31:11 +0000 (11:31 -0400)
committerSage Weil <sage@redhat.com>
Fri, 7 Aug 2015 14:16:03 +0000 (10:16 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/include/types.h

index 89b3acf849951c0eb3da69a4ccfcd2960a5c04b1..9de4e1c42070576c9eb2cd92e24ab6ae86d4f481 100644 (file)
@@ -140,6 +140,17 @@ inline ostream& operator<<(ostream& out, const set<A>& iset) {
   return out;
 }
 
+template<class A, class C>
+inline ostream& operator<<(ostream& out, const set<A, C>& iset) {
+  for (typename set<A, C>::const_iterator it = iset.begin();
+       it != iset.end();
+       ++it) {
+    if (it != iset.begin()) out << ",";
+    out << *it;
+  }
+  return out;
+}
+
 template<class A>
 inline ostream& operator<<(ostream& out, const multiset<A>& iset) {
   for (typename multiset<A>::const_iterator it = iset.begin();