stdendian(3)
std::endian - std::endian
Synopsis
Defined in header <type_traits>
enum class endian
{
little = /*implementation-defined*/, (1) (since C++20)
big = /*implementation-defined*/,
native = /*implementation-defined*/
};Indicates the endianness of all scalar_types:
- If all scalar types are little-endian, std::endian::native equals std::endian::little
- If all scalar types are big-endian, std::endian::native equals std::endian::big Corner case platforms are also supported:
- If all scalar types have sizeof equal to 1, endianness does not matter and all three values, std::endian::little, std::endian::big, and std::endian::native are the same
- If the platform uses mixed endian, std::endian::native does not equal either std::endian::big nor std::endian::little
Possible implementation
Example
This section is incomplete Reason: no example