19#if __has_include(<endian.h>)
21#elif __has_include(<sys/endian.h>)
22 #include <sys/endian.h>
27namespace seqan3::detail
41template <std::
integral type>
42constexpr type to_little_endian(type
const in)
noexcept
50 static_assert(
sizeof(type) <= 8,
51 "Can only convert the byte encoding for integral numbers with a size of up to 8 bytes.");
53 "Can only convert the byte encoding for integral numbers whose byte size is a power of two.");
55 if constexpr (
sizeof(type) == 2)
57 else if constexpr (
sizeof(type) == 4)
59 else if constexpr (
sizeof(type) == 8)
67 "Expected a little-endian or big-endian platform.");
The <bit> header from C++20's standard library.
The <concepts> header from C++20's standard library.
constexpr bool has_single_bit(T x) noexcept
Checks if x is an integral power of two.
Definition: bit:151
@ native
implementation-defined
@ little
implementation-defined
@ big
implementation-defined