以下の内容はhttps://yohhoy.hatenadiary.jp/entry/20130326/p1より取得しました。


Logical XOR operator Revival

C++ Evolution Working Group(EWG)に「論理XOR演算子^^」なるものが提案(?)されているが…
2023-07-23追記:同提案は2013年会合にて却下(NAD)*1されている。

2024-11-26追記:C++2c(C++26)以降に向けたReflection関連提案*2(→id:yohhoy:20250305)において、演算子^^を用いる構文*3が採択された。"unibrow operator"=「一本眉演算子」だそう🤨*4

C++ Standard Evolution Active Issues List, #37. Logical xor operatorより一部引用。

(snip) This has traditionally been dismissed as un-necessary, as it is equivalent to boolean operator!=, and there is no short-circuiting benefit to justify adding it. However, contextual conversions to 'bool' are handled specially for logical operators, and in that context it would be completing a hole in the language. (snip)

function<void()> a;
function<void()> b;
assert(a != b);  // does not compile
assert(a ^^ b);  // would compile, and assert!

どうでもよすぎるメモ:「(a ^^ b);」が煽り系顔文字に見えて仕方ない。

2015-03-05追記:C言語での同話題に対するDennis Ritchie氏の回答 http://c-faq.com/misc/xor.dmr.html




以上の内容はhttps://yohhoy.hatenadiary.jp/entry/20130326/p1より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14