On 01/03/2017 00:09, Joseph Rushton Wakeling wrote:
> On Tuesday, 28 February 2017 at 00:22:28 UTC, sarn wrote:
>>> If you ever have doubts, you can always use something like this to
>>> check:
>>> assert (__ctfe);
>> Sorry, "enforce" would more appropriate if you're really checking.
> if (!__ctfe) assert(false);
> ... might be the best option.  That shouldn't be compiled out even in
> -release builds.
thats a nice idea! is this happening because of assert(false) being
always part of release builds (as mentioned here:
https://dlang.org/spec/contracts.html#assert_contracts) or because the
if would have no instructions anymore if this is removed.


Reply via email to