Hello, I need help with an error with my overloaded operator <<.
The following works for my vector which uses array indexing to output the object, but the set which uses the iterator doesn't work.
1 2
vector<MyClass> myVector;
set<MyClass> mySet;
1 2 3 4 5 6
std::ostream& operator<<(std::ostream &os, MyClass &myClass)
{
os << "The name is: " << myClass.name;
return os;
}