...
Noncompliant Code Example
Code Block | ||
---|---|---|
| ||
void process(int index) { assert(index++ > 0); /* side effect */ /* ... */ } |
...
Avoid the possibility of side effects in assertions.
Code Block | ||
---|---|---|
| ||
void process(int index) { assert(index > 0); /* no side effect */ ++index; /* ... */ } |
...