Confusion over enforce and assert - both are compiled out in release mode
ag0aep6g via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Aug 27 03:08:15 PDT 2017
On 08/27/2017 12:02 PM, Andrew Chapman wrote:
> However, I am finding that BOTH enforce and assert are compiled out by
> dmd and ldc in release mode. Is there a standard way of doing what
> enforce does inside an "in" contract block that will work in release mode?
>
> I'm guessing I should write my own function for now.
The whole `in` block is ignored in release mode. Doesn't matter what you
put in there. Nothing of it will be compiled.
More information about the Digitalmars-d-learn
mailing list