From: Sage Weil Date: Tue, 8 Nov 2016 21:05:12 +0000 (-0500) Subject: include/types: make operator<< printers generic X-Git-Tag: v11.1.0~326^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9d3ac7aa6fdda653a5fda8866318e5e4ff52a6f9;p=ceph.git include/types: make operator<< printers generic Yay, auto! Signed-off-by: Sage Weil --- diff --git a/src/include/types.h b/src/include/types.h index 663430eab990..51bcac82bbec 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -98,7 +98,7 @@ inline ostream& operator<<(ostream& out, const pair& v) { template inline ostream& operator<<(ostream& out, const vector& v) { out << "["; - for (typename vector::const_iterator p = v.begin(); p != v.end(); ++p) { + for (auto p = v.begin(); p != v.end(); ++p) { if (p != v.begin()) out << ","; out << *p; } @@ -108,7 +108,7 @@ inline ostream& operator<<(ostream& out, const vector& v) { template inline ostream& operator<<(ostream& out, const deque& v) { out << "<"; - for (typename deque::const_iterator p = v.begin(); p != v.end(); ++p) { + for (auto p = v.begin(); p != v.end(); ++p) { if (p != v.begin()) out << ","; out << *p; } @@ -124,7 +124,7 @@ inline ostream& operator<<(ostream&out, const boost::tuple &t) { template inline ostream& operator<<(ostream& out, const list& ilist) { - for (typename list::const_iterator it = ilist.begin(); + for (auto it = ilist.begin(); it != ilist.end(); ++it) { if (it != ilist.begin()) out << ","; @@ -135,7 +135,7 @@ inline ostream& operator<<(ostream& out, const list& ilist) { template inline ostream& operator<<(ostream& out, const set& iset) { - for (typename set::const_iterator it = iset.begin(); + for (auto it = iset.begin(); it != iset.end(); ++it) { if (it != iset.begin()) out << ","; @@ -146,7 +146,7 @@ inline ostream& operator<<(ostream& out, const set& iset) { template inline ostream& operator<<(ostream& out, const multiset& iset) { - for (typename multiset::const_iterator it = iset.begin(); + for (auto it = iset.begin(); it != iset.end(); ++it) { if (it != iset.begin()) out << ","; @@ -159,7 +159,7 @@ template inline ostream& operator<<(ostream& out, const map& m) { out << "{"; - for (typename map::const_iterator it = m.begin(); + for (auto it = m.begin(); it != m.end(); ++it) { if (it != m.begin()) out << ","; @@ -173,7 +173,7 @@ template inline ostream& operator<<(ostream& out, const multimap& m) { out << "{{"; - for (typename multimap::const_iterator it = m.begin(); + for (auto it = m.begin(); it != m.end(); ++it) { if (it != m.begin()) out << ",";