If I have a C++ set and iterator:
set<Person> personList;
set<Person>::const_iterator location;
How can I print out the contents of the set? They are all person objects, and I have overloaded operator<< for Person.
The line that errors is in a basic for loop:
cout << location
Netbeans gives:
proj.cpp:78: error: no match for ‘operator<<’ in ‘std::cout << location’
It looks like it wants an overload for the iterator's operator<<.
Basically, I am taking objects that used to be stored in an array format, but are now in a set. What is the equivalent to cout << array[i] for sets?