Boost logo

Boost :

Subject: Re: [boost] [Boost-users] [Review] ITL review starts today, February 18th
From: John Reid (j.reid_at_[hidden])
Date: 2010-03-04 12:40:08

Joachim Faulhaber wrote:
> 2010/3/4 John Reid <j.reid_at_[hidden]>:
>>>> The default interval type is closed. Isn't right-open a more natural
>>>> choice
>>>> for most applications?
>>> Good question ... I tried to change this in the past but encountered
>>> problems with unsigned integral domain types that flipped to max_int
>>> by singular applications of decrement operator -- in the current
>>> implementation. May be I should check this point more thoroughly
>>> again. I could get rid of the unloved unon<T>() meta function. ...
>> You seem to suggest you apply operator-- on integral domains here. Why not
>> make the distance between intervals available when the domain is integral?
>> This would be similar to the availability of first and last when the domain
>> is discrete.
> For all of the interval functions it turns out, that the functionality
> that I offer, which does not include interval arithmetics, only needs
> very few basic operations: <, ++, and -- on the the bound members of
> type domain_type. This keeps the requirements on my Interval parameter
> minimal and allows for a greater class of instance_types for parameter
> domain_type.
> I know, that I am not completely consequent here. Functions length()
> and cardinality() use operator - . But if you don't need to call them,
> you can work with more primitive domain_type.

For my uses I would like to see a method to calculate the distance
between 2 intervals available when the domain supports it. I feel many
users are going to write this functionality themselves. Also a method to
return the gap between 2 intervals would be useful. Just my 2 cents.

Boost list run by bdawes at, gregod at, cpdaniel at, john at