template <unsigned ORDER>
struct Endian
Defined at line 39 of file ../../third_party/llvm-libc/src/src/__support/endian_internal.h
Converts uint8_t, uint16_t, uint32_t, uint64_t to its big or little endian
counterpart.
We use explicit template specialization:
- to prevent accidental integer promotion.
- to prevent fallback in (unlikely) case of middle-endianness.
Public Members
static const bool IS_LITTLE
static const bool IS_BIG
Public Methods
template <typename T>
T from_big_endian (T value)
Converting "to" and "from" a given endianness is actually the same
operation, but we provide dedicated functions to let the user express their
intent clearly.
Defined at line 48 of file ../../third_party/llvm-libc/src/src/__support/endian_internal.h
template <typename T>
T from_little_endian (T value)
Defined at line 51 of file ../../third_party/llvm-libc/src/src/__support/endian_internal.h
template <typename T>
T to_big_endian (T value)
template <typename T>
T to_little_endian (T value)