assert(0) behavior

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 3 08:18:10 PDT 2015


On Monday, 3 August 2015 at 14:34:52 UTC, Steven Schveighoffer 
wrote:
> Why do we do this?

Because all asserts must be completely removed in -release

Yet assert(0) effectively mean "unreachable code" (it is actually 
defined that way in spec) and thus it is possible to ensure extra 
"free" bit of safety by crashing the app.



More information about the Digitalmars-d mailing list