template<class A, class Alloc>
inline ostream& operator<<(ostream& out, const vector<A,Alloc>& v) {
out << "[";
- for (typename vector<A>::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;
}
template<class A, class Alloc>
inline ostream& operator<<(ostream& out, const deque<A,Alloc>& v) {
out << "<";
- for (typename deque<A>::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;
}
template<class A, class Alloc>
inline ostream& operator<<(ostream& out, const list<A,Alloc>& ilist) {
- for (typename list<A>::const_iterator it = ilist.begin();
+ for (auto it = ilist.begin();
it != ilist.end();
++it) {
if (it != ilist.begin()) out << ",";
template<class A, class Comp, class Alloc>
inline ostream& operator<<(ostream& out, const set<A, Comp, Alloc>& iset) {
- for (typename set<A, Comp>::const_iterator it = iset.begin();
+ for (auto it = iset.begin();
it != iset.end();
++it) {
if (it != iset.begin()) out << ",";
template<class A, class Comp, class Alloc>
inline ostream& operator<<(ostream& out, const multiset<A,Comp,Alloc>& iset) {
- for (typename multiset<A,Comp>::const_iterator it = iset.begin();
+ for (auto it = iset.begin();
it != iset.end();
++it) {
if (it != iset.begin()) out << ",";
inline ostream& operator<<(ostream& out, const map<A,B,Comp,Alloc>& m)
{
out << "{";
- for (typename map<A,B,Comp>::const_iterator it = m.begin();
+ for (auto it = m.begin();
it != m.end();
++it) {
if (it != m.begin()) out << ",";
inline ostream& operator<<(ostream& out, const multimap<A,B,Comp,Alloc>& m)
{
out << "{{";
- for (typename multimap<A,B,Comp>::const_iterator it = m.begin();
+ for (auto it = m.begin();
it != m.end();
++it) {
if (it != m.begin()) out << ",";