warning when assert() modifies variables
<p>Is there anything I can do to get a compiler warning when one modifies a variable inside an <code>assert()</code> or a <code>debug_print()</code>?</p>

<p>I want to prevent mistakes like these from happening</p>

<pre><code>int i=0;
assert((++i)); // i is modified only in debug mode

std::set&lt;int&gt; s;
debug_print(("item inserted: %d\n", s.insert(5).first )); // set is modified only in debug mode
</code></pre>

<p>Suppose I have set of wrapper functions that are built on debug mode only, where I can do the necessary checks</p>

<pre><code>MyDbgAssert() // #define that wraps assert()
MyDbgPrint()  // #define that wraps printf() 
</code></pre>
