Boost logo

Boost :

From: James Porter (porterj_at_[hidden])
Date: 2008-05-22 19:21:22


Joachim Faulhaber wrote:
> only syntactically an Addability, semantically rather Concatenatablity
> (strange word ;-) But you are right. I focused too much on integral
> numerical types.

Trying to figure out what, qualitatively, makes a binary operation
"addition" is a hard question, and probably out scope here, but I
digress. :)

> The date and time implementations that I've seen so far are all based
> on integral numeric types including boost::date_time. Implicit in this
> implementation is the property of a least incrementable unit. Based on
> this property incrementation and decrementation can always be
> implemented. To me this seems to be a rather universal property and
> not only detail of the implementing private member.

Actually, Visual Basic 6 uses a double to store DateTimes, with the
integral portion representing date and the fractional portion
representing time. Of course, Visual Basic 6 isn't what I'd recommend to
use as a model for language design.

I think it would make more sense to use the date/time iterators in
Boost.DateTime (which I just now learned of!). They allow
incrementing/decrementing with respect to a particular unit of measure,
which lets the user completely ignore the underlying implementation of
the date_time object.

- Jim


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