15 #ifndef ABSL_RANDOM_INTERNAL_TRAITS_H_
16 #define ABSL_RANDOM_INTERNAL_TRAITS_H_
20 #include <type_traits>
22 #include "absl/base/config.h"
26 namespace random_internal {
37 template <
typename A,
typename B>
38 class is_widening_convertible {
48 static constexpr
int rank() {
49 return !std::numeric_limits<T>::is_integer +
50 std::numeric_limits<T>::is_signed;
57 static constexpr
bool value =
58 std::numeric_limits<A>::digits <= std::numeric_limits<B>::digits &&
59 rank<A>() <= rank<B>();
68 struct unsigned_bits<8> {
84 #ifdef ABSL_HAVE_INTRINSIC_INT128
87 using type = __uint128_t;
91 template <
typename IntType>
92 struct make_unsigned_bits {
93 using type =
typename unsigned_bits<std::numeric_limits<
101 #endif // ABSL_RANDOM_INTERNAL_TRAITS_H_