diff --git a/src/include/types.h b/src/include/types.h index 3593f5af292..663430eab99 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -95,8 +95,8 @@ inline ostream& operator<<(ostream& out, const pair& v) { return out << v.first << "," << v.second; } -template -inline ostream& operator<<(ostream& out, const vector& v) { +template +inline ostream& operator<<(ostream& out, const vector& v) { out << "["; for (typename vector::const_iterator p = v.begin(); p != v.end(); ++p) { if (p != v.begin()) out << ","; @@ -105,8 +105,8 @@ inline ostream& operator<<(ostream& out, const vector& v) { out << "]"; return out; } -template -inline ostream& operator<<(ostream& out, const deque& v) { +template +inline ostream& operator<<(ostream& out, const deque& v) { out << "<"; for (typename deque::const_iterator p = v.begin(); p != v.end(); ++p) { if (p != v.begin()) out << ","; @@ -122,8 +122,8 @@ inline ostream& operator<<(ostream&out, const boost::tuple &t) { return out; } -template -inline ostream& operator<<(ostream& out, const list& ilist) { +template +inline ostream& operator<<(ostream& out, const list& ilist) { for (typename list::const_iterator it = ilist.begin(); it != ilist.end(); ++it) { @@ -133,9 +133,9 @@ inline ostream& operator<<(ostream& out, const list& ilist) { return out; } -template -inline ostream& operator<<(ostream& out, const set& iset) { - for (typename set::const_iterator it = iset.begin(); +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 << ","; @@ -144,9 +144,9 @@ 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(); +template +inline ostream& operator<<(ostream& out, const multiset& iset) { + for (typename multiset::const_iterator it = iset.begin(); it != iset.end(); ++it) { if (it != iset.begin()) out << ","; @@ -155,22 +155,11 @@ inline ostream& operator<<(ostream& out, const set& iset) { return out; } -template -inline ostream& operator<<(ostream& out, const multiset& iset) { - for (typename multiset::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 map& m) +template +inline ostream& operator<<(ostream& out, const map& m) { out << "{"; - for (typename map::const_iterator it = m.begin(); + for (typename map::const_iterator it = m.begin(); it != m.end(); ++it) { if (it != m.begin()) out << ","; @@ -180,25 +169,11 @@ 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) +template +inline ostream& operator<<(ostream& out, const multimap& m) { out << "{{"; - for (typename multimap::const_iterator it = m.begin(); + for (typename multimap::const_iterator it = m.begin(); it != m.end(); ++it) { if (it != m.begin()) out << ",";