diff options
Diffstat (limited to 'abseil-cpp/absl/random/uniform_int_distribution.h')
-rw-r--r-- | abseil-cpp/absl/random/uniform_int_distribution.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/abseil-cpp/absl/random/uniform_int_distribution.h b/abseil-cpp/absl/random/uniform_int_distribution.h index da66564..fae8025 100644 --- a/abseil-cpp/absl/random/uniform_int_distribution.h +++ b/abseil-cpp/absl/random/uniform_int_distribution.h @@ -97,7 +97,7 @@ class uniform_int_distribution { result_type lo_; unsigned_type range_; - static_assert(std::is_integral<result_type>::value, + static_assert(random_internal::IsIntegral<result_type>::value, "Class-template absl::uniform_int_distribution<> must be " "parameterized using an integral type."); }; // param_type @@ -125,7 +125,7 @@ class uniform_int_distribution { template <typename URBG> result_type operator()( URBG& gen, const param_type& param) { // NOLINT(runtime/references) - return param.a() + Generate(gen, param.range()); + return static_cast<result_type>(param.a() + Generate(gen, param.range())); } result_type a() const { return param_.a(); } @@ -196,7 +196,7 @@ typename random_internal::make_unsigned_bits<IntType>::type uniform_int_distribution<IntType>::Generate( URBG& g, // NOLINT(runtime/references) typename random_internal::make_unsigned_bits<IntType>::type R) { - random_internal::FastUniformBits<unsigned_type> fast_bits; + random_internal::FastUniformBits<unsigned_type> fast_bits; unsigned_type bits = fast_bits(g); const unsigned_type Lim = R + 1; if ((R & Lim) == 0) { |