Why don't we have bitwise rotation operators in C / C ++?
What stood in the way of new operators that have been added to the C / C ++ standard, for example <<<
, and >>>
for bit-wise operations of the left and right rotation? Is there a reason why standards organizations cannot include such operators in a future specification?
I know there are other ways to do this:
-
&
>>
|
<<
combo - Internal functions
- Inline assembly
Problems with these workarounds:
- Performance
- Readability
- Potentially more complex code generation
- Platform / Compiler Dependency
To me it looks like an inconsistency. If they're already making an effort to provide simple, readable high-performance operators for &
|
^
<<
and >>
, it shouldn't be any harder to support 8-, 16-, 32-, and 64-bit signed / unsigned values.
source to share
No one has answered this question yet
See similar questions:
or similar: