]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.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>
Mon, 8 Dec 2025 23:25:28 +0000 (18:25 -0500)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/include/types.h

index cc888465196bf34a3cf3fba9e32d607df37fcec8..e277afbee6ad62676504657ef8f12cbae3878c8a 100644 (file)
@@ -115,6 +115,10 @@ inline std::ostream& operator<<(std::ostream& out, const std::unordered_map<A,B,
 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 {
 template<typename... Ts>
@@ -293,6 +297,25 @@ 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 {