That's the most ... instructive ... example I've ever seen.
Type: Posts; User: tabstop
That's the most ... instructive ... example I've ever seen.
Well. The most obvious thing would be this:
class Reservation {
//whatever
};
bool operator< (Reservation left, Reservation right) {
/* I'm assuming that getDate gets some sort of...
When I said "sets automatically sort" I meant exactly what I said. If you were storing, say, ints or floats it would be completely automatic. But since you just made up a Reservation object out of...
You'll have to decide whether you want a set or a vector. Sets automatically sort, but you don't get to use [brackets]. Vectors allow you to use [brackets], but you will have to keep them sorted...
You are using this magic word "set". Do you have a set, somewhere? If so, then yes it is sorted, although you will have to define the ordering yourself. (If you really mean that you have a set of...