
21 Jun
2009
21 Jun
'09
9:12 p.m.
Maciej Sobczak wrote:
Are there any use cases that will become invalid if the tm_mday will be set to 1?
Andrey Semashev noted that in the case of duration such a value is correct. I would argue, however, that duration and "point in time" should be distinct types - "overloading" std::tm for handling durations is a bad idea for the reasons explained above.
That's right, but there's no standard type to express durations. And I agree, to_tm overload for time_duration might not have been a good idea. I guess, there was a good reason to provide it.