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
44 if constexpr (std::endian::native == std::endian::little)
48 else if constexpr (std::endian::native == std::endian::big)
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)
66 static_assert(std::endian::native == std::endian::little || std::endian::native == std::endian::big,
67 "Expected a little-endian or big-endian platform.");
T has_single_bit(T... args)