Considering the possible implementation here:
enum class endian
{
#ifdef _WIN32
little = 0,
big = 1,
native = little
#else
little = __ORDER_LITTLE_ENDIAN__,
big = __ORDER_BIG_ENDIAN__,
native = __BYTE_ORDER__
#endif
};
Is it sure that
__ORDER_LITTLE_ENDIAN__, __ORDER_BIG_ENDIAN__, __BYTE_ORDER__
are defined in other platforms than WIN32?
Before C++20 is released, is it possible to define such an enum for endianness? Otherwise, how to do it properly?