13 if constexpr (std::is_unsigned_v<T> || std::is_enum_v<T>)
14 return static_cast<T>(0
ULL);
16 return static_cast<T>(-(1LL << (
bits - 1LL)));
22 if constexpr (std::is_unsigned_v<T> || std::is_enum_v<T>)
23 return static_cast<T>((1ULL <<
bits) - 1ULL);
25 return static_cast<T>(((1LL <<
bits) - 1LL) - (1LL << (
bits - 1LL)));
30 template<
typename T,
typename =
void>
33 template<
typename R,
typename...
Ts>
41 template<
typename T,
typename =
void>
51 using type = std::underlying_type_t<T>;
58 using type = std::remove_pointer_t<T>;
A packed pointer-like type which takes advantage of any bits that don't get used due to alignment.
Definition packed_ptr.h:18
typename underlying_type< T >::type underlying_type_t
Definition packed_ptr_fwd.h:62
constexpr uintmax_t log2(uintmax_t n) noexcept
Definition bits.h:7
constexpr bool has_no_value_type_v
Definition meta.h:17
constexpr T min_range(size_t bits)
Definition packed_ptr_fwd.h:11
constexpr bool is_function_pointer_v
Definition packed_ptr_fwd.h:37
constexpr T max_range(size_t bits)
Definition packed_ptr_fwd.h:20
Definition cascading.h:16
Definition packed_ptr_fwd.h:31
std::underlying_type_t< T > type
Definition packed_ptr_fwd.h:51
std::remove_pointer_t< T > type
Definition packed_ptr_fwd.h:58
Definition packed_ptr_fwd.h:43
T type
Definition packed_ptr_fwd.h:44