From 1b1eec29ae17677a3388404afa274515d9aa812d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 16 Oct 2017 14:27:59 -0500 Subject: [PATCH] include/types: flat_set operator<< Signed-off-by: Sage Weil --- src/include/types.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/include/types.h b/src/include/types.h index 99fad9ced8e..902aa149064 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -54,6 +54,8 @@ extern "C" { #include #include #include +#include +#include #include #include #include @@ -106,6 +108,10 @@ inline ostream& operator<<(ostream& out, const list& ilist); template inline ostream& operator<<(ostream& out, const set& iset); template +inline ostream& operator<<(ostream& out, const boost::container::flat_set& iset); +template +inline ostream& operator<<(ostream& out, const boost::container::flat_map& iset); +template inline ostream& operator<<(ostream& out, const multiset& iset); template inline ostream& operator<<(ostream& out, const map& m); @@ -166,6 +172,28 @@ inline ostream& operator<<(ostream& out, const set& iset) { return out; } +template +inline ostream& operator<<(ostream& out, const boost::container::flat_set& iset) { + for (auto it = iset.begin(); + it != iset.end(); + ++it) { + if (it != iset.begin()) out << ","; + out << *it; + } + return out; +} + +template +inline ostream& operator<<(ostream& out, const boost::container::flat_map& m) { + for (auto it = m.begin(); + it != m.end(); + ++it) { + if (it != m.begin()) out << ","; + out << it->first << "=" << it->second; + } + return out; +} + template inline ostream& operator<<(ostream& out, const multiset& iset) { for (auto it = iset.begin();