From: Sage Weil Date: Wed, 22 Jul 2015 14:48:12 +0000 (-0400) Subject: include/types: map operator<< with comparator X-Git-Tag: v9.1.0~346^2~41 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c56edf8e0c4ea38cfafaa7dcafff6b6739f815f3;p=ceph.git include/types: map operator<< with comparator Signed-off-by: Sage Weil --- diff --git a/src/include/types.h b/src/include/types.h index ddb0e9aed72..89b3acf8499 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) {