checkedint call removal

Ola Fosheim Gr via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 27 21:58:02 PDT 2014


On Monday, 28 July 2014 at 04:44:04 UTC, Walter Bright wrote:
> On 7/27/2014 1:54 PM, bearophile wrote:
>> Walter Bright:
>>
>>> Instead of adding more language features, purpose existing 
>>> ones:
>>>
>>>    assert(exp >= min && exp <= max);
>>
>> I don't see how this can solve the problem I have discussed. 
>> Please explain better.
>
> That tells the compiler that the exp is within min and max 
> after that point.

Conflating run time debug checks with programmer provided 
guarantees sounds dangerous. Call it "assume" not "assert" then.


More information about the Digitalmars-d mailing list