Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-04-01 07:57:49


Keith Burton wrote:
> Jonathan Turkanis wrote:
> [snip]
>> It seems to me that in some cases developers will be able to reason
>> that based on the numerators and denominators of the instances of
>> rationals they explicitly construct and the type and number of
>> operations they need to perform, no overflow will occur if they use,
>> say, rational<int>. In some cases, they will reason incorrectly; this
>> is the type of logic error which might be usefully signaled using
>> assertions.
>>
> I hope you meant using exceptions as it is not possible to test all
> possible inputs to the calculations

No, I was claiming that in some cases a developer might know the range of all
possible inputs, and be able to reason that no overflow could occur. If this
reasoning is correct -- and usually one must trust the developer's judgment --
using exceptions would be unnecessary.

Jonathan


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