M
Magcialking
template<class T>
ostream& operator<< (ostream& out, const list<T>& lst) {
for (list<T>::const_iterator ref = lst.begin(); ref !=
lst.end();ref++)
/*Compiler says here, ';' shoud occur before ref,and ref is not
declared,but I really don't know what's the problem here*/
out << *ref;
return out;
}
ostream& operator<< (ostream& out, const list<T>& lst) {
for (list<T>::const_iterator ref = lst.begin(); ref !=
lst.end();ref++)
/*Compiler says here, ';' shoud occur before ref,and ref is not
declared,but I really don't know what's the problem here*/
out << *ref;
return out;
}