Go to the documentation of this file.
28 #ifndef ABSL_RANDOM_UNIFORM_INT_DISTRIBUTION_H_
29 #define ABSL_RANDOM_UNIFORM_INT_DISTRIBUTION_H_
34 #include <type_traits>
36 #include "absl/base/optimization.h"
37 #include "absl/random/internal/fast_uniform_bits.h"
38 #include "absl/random/internal/iostream_state_saver.h"
39 #include "absl/random/internal/traits.h"
40 #include "absl/random/internal/wide_multiply.h"
57 template <
typename IntType =
int>
58 class uniform_int_distribution {
86 return a.lo_ ==
b.lo_ &&
a.range_ ==
b.range_;
101 "Class-template absl::uniform_int_distribution<> must be "
102 "parameterized using an integral type.");
120 template <
typename URBG>
125 template <
typename URBG>
142 return a.param_ ==
b.param_;
151 template <
typename URBG>
160 template <
typename CharT,
typename Traits,
typename IntType>
162 std::basic_ostream<CharT, Traits>& os,
167 os << static_cast<stream_type>(
x.a()) << os.fill()
172 template <
typename CharT,
typename Traits,
typename IntType>
174 std::basic_istream<CharT, Traits>& is,
193 template <
typename IntType>
194 template <
typename URBG>
202 if ((R & Lim) == 0) {
248 auto product = helper::multiply(
bits, Lim);
263 while (helper::lo(product) < threshold) {
265 product = helper::multiply(
bits, Lim);
269 return helper::hi(product);
275 #endif // ABSL_RANDOM_UNIFORM_INT_DISTRIBUTION_H_
#define ABSL_PREDICT_FALSE(x)
istream_state_saver< std::basic_istream< CharT, Traits > > make_istream_state_saver(std::basic_istream< CharT, Traits > &is, std::ios_base::fmtflags flags=std::ios_base::dec|std::ios_base::scientific|std::ios_base::skipws)
ABSL_NAMESPACE_BEGIN std::ostream & operator<<(std::ostream &os, absl::LogSeverity s)
typename unsigned_bits< std::numeric_limits< typename MakeUnsigned< IntType >::type >::digits >::type type
#define ABSL_NAMESPACE_END
#define ABSL_NAMESPACE_BEGIN
const typedef int * result_type
OPENSSL_EXPORT ASN1_BIT_STRING * bits
OPENSSL_EXPORT GENERAL_NAME * gen
constexpr uint128 operator>>(uint128 lhs, int amount)
ostream_state_saver< std::basic_ostream< CharT, Traits > > make_ostream_state_saver(std::basic_ostream< CharT, Traits > &os, std::ios_base::fmtflags flags=std::ios_base::dec|std::ios_base::left|std::ios_base::scientific)
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:44