checkedint call removal

Ary Borenszweig via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 30 14:32:49 PDT 2014


On 7/30/14, 5:47 PM, Walter Bright wrote:
> On 7/30/2014 7:36 AM, Ary Borenszweig wrote:
>> Now, if you compile in release mode, according to Walter, all the
>> "asserts" are
>> gone (which, as a side note, is something I don't like: in every case
>> it should
>> throw an AssertError). So the question is: can the compiler still
>> replace that
>> writeln call?
>
> Yes.
>

So if there's a logic in your program, in release mode it won't crash 
immediately but continue with undefined behaviour.

I can't imagine any case where I would want this in my programs. I think 
I would always use enforce and never assert.


More information about the Digitalmars-d mailing list