
5 May
2006
5 May
'06
5:32 p.m.
Time durations can be divided by an integer to produce a duration (e.g. hours(1)/60 == minutes(1);), but can't be divided by another duration to produce an integer (e.g. hours(1)/minutes(1) == 60;). Could this be added to time_duration.hpp: int operator/(const duration_type& d) const { return (ticks_ / d.ticks_); } or maybe better, this: double operator/(const duration_type& d) const { return (static_cast<double>(ticks_) / d.ticks_); } The same thing can already be accomplished already with duration1.ticks()/duration2.ticks(), but duration1/duration2 seems more natural and fits well with the rest of the date_time operators. Beth