C++ and,or,not,xor keywords

C++Operators

C++ Problem Overview


> Possible Duplicate:
> The written versions of the logical operators.

I notice that C++ define keyword and, or, not, xor, and_eq, or_eq, not_eq and xor_eq as an alternative to &&, ||, !, ^, &=, |=, != and |=. and they're rarely used! What's wrong? Are they not portable?

C++ Solutions


Solution 1 - C++

They come from C AFAIR from times when it was not known what special symbols are on the keyboard. So to have portable language they were defined so anyone can use C even if they used keyboard with no &, |, or ^ (etc.).

Nowadays when QWERTY is a standard (with AZWERTY & co. as variations) it is no longer an issue.

PS. And of course for obfuscation code competitions ;)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionurayView Question on Stackoverflow
Solution 1 - C++Maciej PiechotkaView Answer on Stackoverflow