diff options
author | Abseil Team <absl-team@google.com> | 2021-11-22 08:22:28 -0800 |
---|---|---|
committer | Derek Mauro <dmauro@google.com> | 2021-11-22 14:44:20 -0500 |
commit | ec0d76f1d012cc1a4b3b08dfafcfc5237f5ba2c9 (patch) | |
tree | 3ed0065b80edc2f3c10b06e0cc9314118f9caa63 /absl/random/internal/uniform_helper.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/internal/uniform_helper.h')
-rw-r--r-- | absl/random/internal/uniform_helper.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/absl/random/internal/uniform_helper.h b/absl/random/internal/uniform_helper.h index 1243bc1c..e68b82ee 100644 --- a/absl/random/internal/uniform_helper.h +++ b/absl/random/internal/uniform_helper.h @@ -100,7 +100,7 @@ using uniform_inferred_return_t = template <typename IntType, typename Tag> typename absl::enable_if_t< absl::conjunction< - std::is_integral<IntType>, + IsIntegral<IntType>, absl::disjunction<std::is_same<Tag, IntervalOpenClosedTag>, std::is_same<Tag, IntervalOpenOpenTag>>>::value, IntType> @@ -131,7 +131,7 @@ uniform_lower_bound(Tag, NumType a, NumType) { template <typename IntType, typename Tag> typename absl::enable_if_t< absl::conjunction< - std::is_integral<IntType>, + IsIntegral<IntType>, absl::disjunction<std::is_same<Tag, IntervalClosedOpenTag>, std::is_same<Tag, IntervalOpenOpenTag>>>::value, IntType> @@ -153,7 +153,7 @@ uniform_upper_bound(Tag, FloatType, FloatType b) { template <typename IntType, typename Tag> typename absl::enable_if_t< absl::conjunction< - std::is_integral<IntType>, + IsIntegral<IntType>, absl::disjunction<std::is_same<Tag, IntervalClosedClosedTag>, std::is_same<Tag, IntervalOpenClosedTag>>>::value, IntType> @@ -201,7 +201,7 @@ is_uniform_range_valid(FloatType a, FloatType b) { } template <typename IntType> -absl::enable_if_t<std::is_integral<IntType>::value, bool> +absl::enable_if_t<IsIntegral<IntType>::value, bool> is_uniform_range_valid(IntType a, IntType b) { return a <= b; } @@ -210,7 +210,7 @@ is_uniform_range_valid(IntType a, IntType b) { // or absl::uniform_real_distribution depending on the NumType parameter. template <typename NumType> using UniformDistribution = - typename std::conditional<std::is_integral<NumType>::value, + typename std::conditional<IsIntegral<NumType>::value, absl::uniform_int_distribution<NumType>, absl::uniform_real_distribution<NumType>>::type; |