<div class="gmail_quote">2010/8/12 gast128 <span dir="ltr"><<a href="mailto:gast128@hotmail.com">gast128@hotmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> <div class="im">> Hello all,<br> > small question: there seems no xor operator in c++ but there is also no Boost<br> > xor functor (like the std::logical_and)?<br> > Scenario: I have 2 data members used in variant like way: only 1 may be<br> valid.<br> > Both valid or both invalid is incorrect.<br> ><br> > Can'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'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>