Boost logo

Boost :

From: Mark Rodgers (mark.rodgers_at_[hidden])
Date: 2002-04-24 00:37:23


From: "Glen Knowles" <gknowles_at_[hidden]>
>
> In order for that to work you must define date to have a resolution equal
to
> the highest resolution of any date system, perhaps the day (second?) in
this
> example, and with a span large enough to cover all possible dates used by
> any system. This doesn't meet the efficiency needs of many applications
that
> are quite happy with, for example, the unix time systems limited span of
Jan
> 1 1970 to ~Jan 18 2038.
>
> I agree that the internal representation is an implementation detail, but
I
> would say it is an implementation detail of the date system being used.
>

If we limit our discussion to dates, and leave times to later, then you
can't need any precision better than a day. A 32bit int allows covers
any range that I consider reasonable, so I see no problem with having a
single date class.

However, if you insist, we can make precision and size of representation
template parameters, as long we leave calendar out. With reasonable
defaults, my example could be changed by s/date/date<>/ and my argument
would still stand.

Mark


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk