D-Scanner
D-Scanner copied to clipboard
Warn about calling non-const or non-pure functions in assert expressions
This causes behavior to differ between debug and release builds.
What is the rationale for this? Can you elaborate a bit more?
What is the rationale for this? Can you elaborate a bit more?
Side effects in asserts will not happen depending on whether the assert is included or not.
void foo(ref int v) { v++; }
int x = 4;
assert(foo(x));
// x is now either 4 or 5