]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
include/types: map operator<< with comparator
authorSage Weil <sage@redhat.com>
Wed, 22 Jul 2015 14:48:12 +0000 (10:48 -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 ddb0e9aed729fa3d3d4b2136180d65f669ef3621..89b3acf849951c0eb3da69a4ccfcd2960a5c04b1 100644 (file)
@@ -165,6 +165,20 @@ inline ostream& operator<<(ostream& out, const map<A,B>& m)
   return out;
 }
 
+template<class A,class B, class C>
+inline ostream& operator<<(ostream& out, const map<A,B,C>& m)
+{
+  out << "{";
+  for (typename map<A,B,C>::const_iterator it = m.begin();
+       it != m.end();
+       ++it) {
+    if (it != m.begin()) out << ",";
+    out << it->first << "=" << it->second;
+  }
+  out << "}";
+  return out;
+}
+
 template<class A,class B>
 inline ostream& operator<<(ostream& out, const multimap<A,B>& m) 
 {