assume, assert, enforce, @safe

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 1 09:52:02 PDT 2014


"Sean Kelly"  wrote in message news:tngnltzwxprebpbcdkgm at forum.dlang.org...

> Druntime uses contracts and asserts in places. Which are of course removed 
> because we ship only a "release" build.  Once again, the worst naming for 
> a compiler switch ever. What I really want is a way to ship release and 
> non-release builds (ie. checked and unchecked) and have the proper one 
> chosen at link time based on build flags. Basically toss the -defaultlib 
> and -debuglib and replace it with -checkedlib and -uncheckedlib.

While shipping a debug version of druntime would be useful, I think the real 
problem is that checking preconditions is disabled by the callee!  If 
preconditions are violated, the error is in the caller, and checking should 
be enabled based on the application's flags. 



More information about the Digitalmars-d mailing list