From: Leonid Usov Date: Wed, 28 Feb 2024 12:41:13 +0000 (+0200) Subject: include/types: add an I/O helper for std::unordered_map X-Git-Tag: v19.1.0~203^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6c59e10c31e3a90f1f3eb47d5b419975df3f29de;p=ceph.git include/types: add an I/O helper for std::unordered_map Signed-off-by: Leonid Usov (cherry picked from commit 42a5fb3b7562dac09dbf4575558820297317965e) --- diff --git a/src/include/types.h b/src/include/types.h index a50a506eb0bc2..6512aae510a76 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -104,6 +104,8 @@ inline std::ostream& operator<<(std::ostream& out, const std::list& ili template inline std::ostream& operator<<(std::ostream& out, const std::set& iset); template +inline std::ostream& operator<<(std::ostream& out, const std::unordered_set& iset); +template inline std::ostream& operator<<(std::ostream& out, const std::multiset& iset); template inline std::ostream& operator<<(std::ostream& out, const std::map& m); @@ -209,6 +211,17 @@ inline std::ostream& operator<<(std::ostream& out, const std::set +inline std::ostream& operator<<(std::ostream& out, const std::unordered_set& iset) { + for (auto it = iset.begin(); + it != iset.end(); + ++it) { + if (it != iset.begin()) out << ","; + out << *it; + } + return out; +} + template inline std::ostream& operator<<(std::ostream& out, const std::multiset& iset) { for (auto it = iset.begin();