assume, assert, enforce, @safe

eles via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 1 13:10:52 PDT 2014


On Friday, 1 August 2014 at 17:19:09 UTC, Sebastiaan Koppe wrote:
> If assertions are disabled in release builds, and you 
> specifically instruct the compiler to build one, are you not 
> assuming that the assertions will hold?
>
> Then what is wrong with extending those assumptions to the 
> optimizer?
>
> Unless the assertions trigger in debug build, you will not end 
> up with bugs in the release.

To support: it seems to me that assert() is nothing more than an 
assume() with a check.

Why the check bothers you if the assumption is still true? 
Compiler just like to do overwork in debug builds, let's grant 
that pleasure to it.


More information about the Digitalmars-d mailing list