DIP 1006 - Preliminary Review Round 1
Walter Bright
newshound2 at digitalmars.com
Tue Mar 6 09:02:33 UTC 2018
On 3/6/2018 12:45 AM, Timon Gehr wrote:
> Anyway, "do not use assert" is not the solution, as I have explained many times
> now.
My interpretation is you want D assert to behave like C assert. C assert and
enforce are purely creatures of the library, with semantics defined by their
library implementation, and have no effect on the core language.
I recommend creating your own library assert, call it 'check' for example, and
give it the semantics you wish. You can even have it expand to nothing for
release builds.
Creating library asserts is why D has special support for __FILE__ and __LINE__
like C does, and for the same reasons.
More information about the Digitalmars-d
mailing list