From 9b8e536f0c4c5991c774147d5e01f0d538a890bf Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 22 Jul 2015 11:31:11 -0400 Subject: [PATCH] include/types: operator<< for set with comparator Signed-off-by: Sage Weil --- src/include/types.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/include/types.h b/src/include/types.h index 89b3acf849951..9de4e1c420705 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -140,6 +140,17 @@ inline ostream& operator<<(ostream& out, const set& iset) { return out; } +template +inline ostream& operator<<(ostream& out, const set& iset) { + for (typename set::const_iterator it = iset.begin(); + it != iset.end(); + ++it) { + if (it != iset.begin()) out << ","; + out << *it; + } + return out; +} + template inline ostream& operator<<(ostream& out, const multiset& iset) { for (typename multiset::const_iterator it = iset.begin(); -- 2.39.5