Huh, I stand corrected. It is defined in the current draft though:
https://eel.is/c++draft/expr.shift
I thought this was part of the guaranteed two's complement change in C++20.
https://eel.is/c++draft/expr.shift
I thought this was part of the guaranteed two's complement change in C++20.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n49...
This is indeed from the C++20 paper P1236R1:
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p12...
In any case, thanks; it's nice to see C++ at least fully embracing the mandate on integers being two's complement, finally. There is enough footguns already without basic arithmetic operators being UB half of the time.