constexpr and endianness
New answer (C++20) c++20 has introduced a new standard library header <bit>. Among other things it provides a clean, portable way to check the endianness. Since my old method relies on some questionable techniques, I suggest anyone who uses it to switch to the check provided by the standard library. Here’s an adapter which allows … Read more