title: In which case is if(a=b) a good idea?
body: <blockquote>
  <p><strong>Possible Duplicate:</strong> <br />
  <a href="https://stackoverflow.com/questions/399792/inadvertent-use-of-instead-of">Inadvertent use of = instead of ==</a></p>
  </blockquote>
  
  <p>C++ compilers let you know via warnings that you wrote,</p>
  <pre><code>if( a = b ) { //...
  </code></pre>
  <p>And that it might be a mistake that you certainly wanted to write:</p>
  <pre><code>if( a == b ) { //...
  </code></pre>
  <p>But is there a case where the warning should be ignored, because it's a good way to use this &quot;feature&quot;?
  I don't see any code clarity reason possible, so is there a case where it’s useful?</p>