|
|
|
|
|
by tialaramex
950 days ago
|
|
This is one of the classic examples where C++ should clearly have picked Unspecified Behaviour rather than Undefined Behaviour but too late now. Nobody wants UB here, and the set of things CPUs actually might provide is enumerable. Maybe I should suggest avoiding the same fate for Rust's unchecked_shl and unchecked_shr. (These aren't stabilized yet unlike the safe options and the rotates) |
|
It's never too late to replace Undefined Behaviour with Unspecified Behaviour.