Is there a definition somewhere in the standard namespace that sets forward:
- Months in a year
- Days in a week
- Hours in a day
- Minutes in an hour
- Seconds in a minute
The struct tm has contains member variables that must be in these ranges, but I can't find the defined limits anywhere.
I'm not even sure if there are locales defined where these wouldn't match the conventional set (12/7/24/60/60).
Even if there aren't potential users with other range limits, I'd sure like to use a define from the standard namespace rather than arbitrarily defining my own.
EDIT:
It looks like I'm not the first to ask for such a thing: http://david.tribble.com/text/c0xcalendar.html
I notice in this proposal there is mention of the struct calendarinfo
which does exactly what I'm looking for.
It looks like the last change on this was 2009. I guess nothing's happened since then? I guess that also means this stuff is not readily available to me?
More info, boost::locale::calendar::maximum seems to accomplish exactly what I'm looking for. I can't use Boost, but I'm certain that the code in Boost is the defacto standard on how to come up with these limits. Unfortuantely I can't seem to get at the implementation of maximum
. Maybe someone else here knows how?