Boost logo

Boost :

From: Joachim Faulhaber (afojgo_at_[hidden])
Date: 2008-05-23 04:34:58


2008/5/23 Frank Birbacher <bloodymir.crap_at_[hidden]>:
> Hi!
>
> Joachim Faulhaber schrieb:
>> which is nice. Yet as for date/time parameters for my interval and
>> interval containers templates my implementation relies on the
>> existence of incrementation on the least available time unit in order
>> to decide things like
>> [1704, 4712) == [1704, 4711]
>
> I suggest to let the user specify a minimal unit.

I agree

>Depending on the
> application the user could think in seconds or less (time measuring for
> events), minutes (calendar application), days (hotel room occupation),
> months/years (records of employment).
>
> I'd like that.
>
so would I.

Every implementation that is based on a numeric integral type provides
that unit which is (internally) denoted as 1. The meaning assigned to
the unit to be
nanosecond, minute or decade is finally a question of interpretation.

For every time<TimeSystem>- type the semantics of the minimal unit
should be chosen as a static property of the types TimeSystem, that
can not be changed for a given type-instance. That way, strong typing
will help not to accidentally mix nanoseconds with decades ;-)

So for every time type there is exacty one minimal time unit, the meaning
of which can chosen as a static propery throu instantiation.

>> Based on
>> this property incrementation and decrementation can always be
>> implemented.
>
> ... using the specified increment. :)
>

cheers
Joachim

-----
Interval Template Library (ITL)
download from http://www.sourceforge.net/projects/itl
documentation http://www.herold-faulhaber.de/itl


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