|
Boost : |
Subject: Re: [boost] [review][constrained_value] Review of Constrained Value Library begins today
From: Deane Yang (deane.yang_at_[hidden])
Date: 2008-12-04 09:08:44
Joe Gottman wrote:
> Deane Yang wrote:
>> Edward Diener wrote:
>>> Deane Yang wrote:
>>>>
>>>> I have an even more extreme view on this. I don't believe any
>>>> arithmetic operations should be permitted for constrained numbers.
>>>> They just don't make sense (would you ever want to add two different
>>>> days of a month?).
>>>
>>> You have chosen a particular type for which arithmetic operations
>>> sometimes make little sense. In many other situations this is not the
>>> case.
>>
>>
>> Could you give an example?
>
>
> One example: adding 2 to Monday to get Wednesday, or adding 2 to
> Saturday to get Monday.
>
>
But that does not correspond to the built-in arithmetic operation. This
is modular arithmetic in disguise, so wouldn't make more sense to use a
modular integer class (integers mod 7) and represent the days of the
week using the numbers 0 to 6?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk