Overloading comparison operators to work with STL sort in C++
问题 I am writing a program that will read in a list of names with social security numbers (not real ones of course) and sort the list based on either last name or ssn, depending on a command line argument. I have overloaded the < operator and also overloaded input and output operators for simplicity. Everything compiles fine until I add the sort function and the output at the end of main. I'm stumped. Any ideas? Any other tips are also greatly appreciated. #include <algorithm> #include <iostream>