title: Logical XOR operator in C++?
body: <p>Is there such a thing? It is the first time I encountered a practical need for it, but I don't see one listed <a href="https://en.wikipedia.org/wiki/The_C%2B%2B_Programming_Language" rel="noreferrer">in Stroustrup</a>. I intend to write:</p>
  
  <pre><code>// Detect when exactly one of A,B is equal to five.
  return (A==5) ^^ (B==5);
  </code></pre>
  
  <p>But there is no <code>^^</code> operator. Can I use the bitwise <code>^</code> here and get the right answer (regardless of machine representation of true and false)? I never mix <code>&amp;</code> and <code>&amp;&amp;</code>, or <code>|</code> and <code>||</code>, so I hesitate to do that with <code>^</code> and <code>^^</code>. </p>
  
  <p>I'd be more comfortable writing my own <code>bool XOR(bool,bool)</code> function instead.</p>