title: De Morgan's Law optimization with overloaded operators
body: <p>Every programmer should know that:  </p>
  
  <p><a href="https://i.stack.imgur.com/DAZCK.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/DAZCK.gif" alt="De Morgan 1"></a><br>
  <a href="https://i.stack.imgur.com/okkHe.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/okkHe.gif" alt="De Morgan 2"></a><br>
  (<a href="https://en.wikipedia.org/wiki/De_Morgan%27s_laws" rel="noreferrer">De Morgan's Laws)</a></p>
  
  <p>Under some circumstances, in order to optimize the program, it may happen that compiler modifies <code>(!p &amp;&amp; !q)</code> to <code>(!(p || q))</code>.</p>
  
  <p>The two expressions are equivalent, and it makes no difference evaluating the first or the second.<br>
  But in C++ it is possible to overload operators, and the overloaded operator may not always respect this property. So transforming the code this way will actually modify the code.  </p>
  
  <p>Should the compiler use De Morgan's Laws when <code>!</code>, <code>||</code> and <code>&amp;&amp;</code> are overloaded?</p>