<div class="gmail_quote">2010/8/12 gast128 <span dir="ltr">&lt;<a href="mailto:gast128@hotmail.com">gast128@hotmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">&gt; Hello all,<br>
&gt; small question: there seems no xor operator in c++ but there is also no Boost<br>
&gt; xor functor (like the std::logical_and)?<br>
&gt; Scenario: I have 2 data members used in variant like way: only 1 may be<br>
valid.<br>
&gt; Both valid or both invalid is incorrect.<br>
&gt;<br>
&gt; Can&#39;t you use !!A != !!B? (or !!A ^ !!B)<br>
<br>
</div>ah quite brilliant! I was thinking about the (a ? !b : b). Still a logical_xor<br>
does also has a documentation value.</blockquote><div><br></div><div>operator^ works fine for booleans, and I guess that&#39;s what you want to apply logical_xor to.</div><div><br></div><div>bool a, b;</div><div>bool c = a ^ b; �// Fine.�</div>
<div><br></div><div>Roman Perepelitsa.</div></div>