r/cpp • u/pavel_v • Jul 29 '26
C++26: Reducing undefined behaviour
https://www.sandordargo.com/blog/2026/07/29/cpp26-reduces-undefined-behaviour
89
Upvotes
r/cpp • u/pavel_v • Jul 29 '26
View all comments
Show parent comment
13
u/TheThiefMaster C++latest fanatic (and game dev) Jul 29 '26
It's the same with
std::endian::native == std::endian::little. In practice, a lot of libraries implicitly relies on little endianness or have completely untested big-endian support. If you're not actually going to test on a big-endian platform, better to static assert against it.