Asserts and side effects

bearophile bearophileHUGS at lycos.com
Mon Nov 30 03:13:00 PST 2009


Lars T. Kyllingstad:
> Would it be possible (and desirable) for the D compiler to statically 
> check that asserts have no side effects?

Only pure asserts?
If you put:
assert (++i == 1);
Inside a function precondition, it gets removed in release mode.

Bye,
bearophile



More information about the Digitalmars-d mailing list