But they ought to be sorted by using their StartTime (DateTime type)
The "smaller" their StartTime,the "sooner" they should begin,so the one with the "smallest" StartTime should be in the "top" of the list.
So,can I overload > operator for DateTime and build a method to compare two DateTime objects (for example: bool DateTime::the_smaller_date()) and then use
list.sort(the_smaller_date()); ?
You wouldn't need to overload that.
you could have a "ConvertToSeconds()" method inside your DateTime class then your equivalent of this line in the example: return ( first.length() < second.length() );
might look like this for you: return ( first.ConvertToSeconds() < second.ConvertToSeconds() );
Edit: oops sorry i re-read what you typed. You don't have to create it, but you would have to come up with some other way of comparing two of your DateTime objects.