仍然无法让这个工作。请帮忙!
template <typename T>
class Container{
public:
...
friend ostream& operator<<(ostream& ostr, const Container<T>& C)
{
for(size_t i=0; i!= data.size(); i++) // ERROR
ostr<<data[i]<<" ";
return ostr;
}
private:
vector<T> data;
};