diff options
author | 2021-11-22 08:22:28 -0800 | |
---|---|---|
committer | 2021-11-22 14:44:20 -0500 | |
commit | ec0d76f1d012cc1a4b3b08dfafcfc5237f5ba2c9 (patch) | |
tree | 3ed0065b80edc2f3c10b06e0cc9314118f9caa63 /absl/random/uniform_int_distribution.h | |
parent | 72c765111173a61de6e4184bb837f855b7869952 (diff) |
Export of internal Abseil changes
--
a0847bf19789c97689f1a8b0133a53b8af5e5caa by Samuel Benzaquen <sbenza@google.com>:
Add support for absl::(u)int128 to random distributions and generators.
PiperOrigin-RevId: 411565479
GitOrigin-RevId: a0847bf19789c97689f1a8b0133a53b8af5e5caa
Change-Id: Ide434bdd93fcab8e90f791796498de14833b667c
Diffstat (limited to 'absl/random/uniform_int_distribution.h')
-rw-r--r-- | absl/random/uniform_int_distribution.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/random/uniform_int_distribution.h b/absl/random/uniform_int_distribution.h index c1f54cce..fae80252 100644 --- a/absl/random/uniform_int_distribution.h +++ b/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(); } |