John Regehr on "Use of Assertions"

Michael michael at toohuman.io
Wed Sep 5 15:59:06 UTC 2018


On Saturday, 1 September 2018 at 20:15:15 UTC, Walter Bright 
wrote:
>
> Note the "may or may not be evaluated." We've debated this here 
> before. I'm rather pleased that John agrees with me on this. 
> I.e. the optimizer can assume the expression is true and use 
> that information to generate better code, even if the assert 
> code generation is turned off.

Is the part about the optimizer true in D's case? Or is this just 
a theoretical advantage to using asserts that are not evaluated 
in production code but left in?


More information about the Digitalmars-d mailing list