Make using compiled libs with debug code better

Paul Backus snarwin at gmail.com
Tue Oct 19 03:09:16 UTC 2021


On Tuesday, 19 October 2021 at 02:02:31 UTC, Tejas wrote:
>
> I thought `enforce` was our `-release` mode error checking 
> mechanism?
>
> Why don't we encourage that instead of trying to change 
> things(which will result in a battle of inertia).

`enforce` and `assert` are not interchangeable. Walter discusses 
the difference at length in this thread from 2014:

https://forum.dlang.org/thread/m07gf1$18jl$1@digitalmars.com

TL;DR: exceptions are for recoverable failures; assertions are 
for non-recoverable failures.


More information about the Digitalmars-d mailing list