file
bit.hNamespaces
- namespace rll
- Contract-programming related functions and classes.
Enums
Functions
-
template <class To, class From>bit_cast(From const& src) noexcept
- Casts value from one type to another by bit copy.
-
template <typename T, typename = std::auto bit_ceil(T x) → T constexpr noexcept
enable_if_t<std:: is_unsigned_v<T>>> - Returns the next power of two of the value.
-
template <typename T, typename = std::auto byteswap(T x) → T constexpr noexcept
enable_if_t<is_num_v<T>>> - Reverses the byte order of the value.
-
template <typename T>auto byteswap_unchecked(T u) → T noexcept
- Reverses the byte order of the value without checking for unique object representations.
-
template <typename T, typename = std::auto has_single_bit(T x) → bool constexpr noexcept
enable_if_t<std:: is_integral_v<T>>> - Checks if the value is an integral power of two.
-
template <typename T, typename = std::auto is_pow2(T x) → bool constexpr noexcept
enable_if_t<std:: is_integral_v<T>>> - Checks if the value is an integral power of two.
-
template <typename T, typename = std::auto popcount(T x) → int constexpr noexcept
enable_if_t<std:: is_integral_v<T>>> - Returns the number of 1 bits in the value.
-
template <typename T, typename = std::auto to_big_endian(T x) → T constexpr noexcept
enable_if_t<is_num_v<T>>> - Reverses the byte order of the value if the native endianness is little.
-
template <typename T, typename = std::auto to_little_endian(T x) → T constexpr noexcept
enable_if_t<is_num_v<T>>> - Reverses the byte order of the value if the native endianness is big.
Defines
- #define RLL_BIG_ENDIAN
- #define RLL_LITTLE_ENDIAN
- #define ___rolly_byteswap16
- #define ___rolly_byteswap32
- #define ___rolly_byteswap64