title: Avoiding unused variables warnings when using assert() in a Release build
body: <p>Sometimes a local variable is used for the sole purpose of checking it in an assert(), like so -</p>
  
  <pre><code>int Result = Func();
  assert( Result == 1 );
  </code></pre>
  
  <p>When compiling code in a Release build, assert()s are usually disabled, so this code may produce a warning about Result being set but never read.</p>
  
  <p>A possible workaround is -</p>
  
  <pre><code>int Result = Func();
  if ( Result == 1 )
  {
      assert( 0 );
  }
  </code></pre>
  
  <p>But it requires too much typing, isn't easy on the eyes and causes the condition to be always checked (yes, the compiler may optimize the check away, but still).</p>
  
  <p>I'm looking for an alternative way to express this assert() in a way that wouldn't cause the warning, but still be simple to use and avoid changing the semantics of assert().</p>
  
  <p>(disabling the warning using a #pragma in this region of code isn't an option, and lowering warning levels to make it go away isn't an option either...).</p>