struct ClassTime { void operator++(); void operator--(); unsigned hour; bool half; }; size_t operator-(const ClassTime& a, const ClassTime& b);
This structure represents a time of day when a class can begin or end. The resolution of this structure is currently 30 minutes.
unsigned hour;
The hour of the day. Can range from 9 to 21.
bool half;
False if it's on the hour, true if it's 30 minutes after the hour.
void operator++();
Increments this object by 30 minutes.
void operator--();
Decrements this object by 30 minutes.
size_t operator-(const ClassTime& a, const ClassTime& b);
The number of time units from b
to a
. Precondition: a
is not earlier than b
.