Is there a logical (boolean) XOR function in C or C++ standard library?

Violet Giraffe picture Violet Giraffe · Jun 10, 2013 · Viewed 23.9k times · Source

I didn't find one, but have a hard time believing there is none.

Answer

Matt Ball picture Matt Ball · Jun 10, 2013

Boolean XOR is the same thing as !=, "not equal."

p | q | p != q
--+---+-------
F | F |   F    
T | F |   T    
F | T |   T    
T | T |   F    

http://en.wikipedia.org/wiki/Truth_table#Logical_conjunction