]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
include/types: Add std::unordered_multimap support
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 21 Oct 2025 19:06:56 +0000 (15:06 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Tue, 21 Jul 2026 21:55:08 +0000 (17:55 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/include/types.h

index cc888465196bf34a3cf3fba9e32d607df37fcec8..a15d790ef5529a2637bf10d8991775221a5ae696 100644 (file)
@@ -114,6 +114,8 @@ template<class A, class B, class Hash, class KeyEqual>
 inline std::ostream& operator<<(std::ostream& out, const std::unordered_map<A,B,Hash, KeyEqual>& m);
 template<class A, class B, class Comp, class Alloc>
 inline std::ostream& operator<<(std::ostream& out, const std::multimap<A,B,Comp,Alloc>& m);
+template <class Key, class T, class Hash, class KeyEqual, class Alloc>
+inline std::ostream& operator<<(std::ostream& out, const std::unordered_multimap<Key, T, Hash, KeyEqual, Alloc>& m);
 }
 
 namespace boost {
@@ -293,6 +295,22 @@ inline std::ostream& operator<<(std::ostream& out, const std::multimap<A,B,Comp,
   return out;
 }
 
+template<class Key, class T, class Hash, class KeyEqual, class Alloc>
+inline std::ostream&
+operator<<(
+  std::ostream& out,
+  const std::unordered_multimap<Key, T, Hash, KeyEqual, Alloc>& m)
+{
+  out << "{{";
+  for (auto it = m.begin();
+       it != m.end();
+       ++it) {
+    if (it != m.begin()) out << ",";
+    out << it->first << "=" << it->second;
+  }
+  out << "}}";
+  return out;
+}
 } // namespace std
 
 namespace boost {