From c56edf8e0c4ea38cfafaa7dcafff6b6739f815f3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 22 Jul 2015 10:48:12 -0400 Subject: [PATCH] include/types: map operator<< with comparator Signed-off-by: Sage Weil --- src/include/types.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/include/types.h b/src/include/types.h index ddb0e9aed729..89b3acf84995 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -165,6 +165,20 @@ inline ostream& operator<<(ostream& out, const map& m) return out; } +template +inline ostream& operator<<(ostream& out, const map& m) +{ + out << "{"; + for (typename map::const_iterator it = m.begin(); + it != m.end(); + ++it) { + if (it != m.begin()) out << ","; + out << it->first << "=" << it->second; + } + out << "}"; + return out; +} + template inline ostream& operator<<(ostream& out, const multimap& m) { -- 2.47.3