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.

+3
c ++ c bit-manipulation bitwise-operators


source to share


No one has answered this question yet

See similar questions:

81
Recommendations for cyclic shifts (rotation) in C ++

or similar:

8499
What is the "->" operator in C ++?
1675
Why is reading lines from stdin much slower in C ++ than Python?
1302
What are bit-shift (bit-shift) operators and how do they work?
1250
Replacing 32-bit loop counter with 64-bit values ​​leads to crazy performance deviations
1138
Why do we need virtual functions in C ++?
961
Where and why do I need to put the keywords "pattern" and "name-type"?
824
Why do C ++ programmers minimize the use of "new"?
302
Why doesn't C ++ have reflection?
283
Why don't C ++ compilers define operator == and operator! =?
153
Real world use case of bitwise operators



All Articles
Loading...
X
Show
Funny
Dev
Pics