4 ms·
I was surprised to read that `and`, `and_eq`, `xor`, etc are all supported "secondary/alternative operators" Never seen them used, but I use them in my C++ cod
by gavinray 5y ago
I was surprised to read that `and`, `and_eq`, `xor`, etc are all supported "secondary/alternative operators"
Never seen them used, but I use them in my C++ code when I have to write it to accomplish something else:
https://en.cppreference.com/w/cpp/language/operator_alternative https://en.cppreference.com/w/cpp/language/operator_alternat...
- inetknght 5y agoI used to use them. Then I was burned by some Very Opinionated managers and coworkers who didn't like seeing new things. It wasn't a hill I was willing to die on; there's more important things to argue about in C++.
- oceanswave 5y agoDevelopment is a massive cargo cult
- josefx 5y agoThey have been around since the first standard and basically only exist as a hack around an ancient non ascii compatible encoding. So unless you got burned in 1995 nothing about them was new. They also aren't very consistent between C derived languages. Mostly because C# inherited its versions from VisualBasic, where And is a bitwise operator instead of a short circuiting one.
- inetknght 5y ago> * So unless you got burned in 1995 nothing about them was new.* I didn't mean to imply that they were new features to the language. I meant to imply that they were new style of coding to the manager & coworkers. Some other features that have burned me from managers & coworkers is `using` to change the visibility of parent class members & functions and CRTP.
- usefulcat 5y agoI use them, some of them anyway. I find them to be more readable (in particular’not’ instead of ‘!’). Also it means that I can reserve ‘&&’ for rvalue references.