30 #ifndef _GLIBCXX_EXPERIMENTAL_RANDOM
31 #define _GLIBCXX_EXPERIMENTAL_RANDOM 1
33 #if __cplusplus >= 201402L
38 _GLIBCXX_BEGIN_NAMESPACE_VERSION
40 namespace experimental {
41 inline namespace fundamentals_v2 {
42 #define __cpp_lib_experimental_randint 201511
47 static thread_local default_random_engine __eng{random_device{}()};
52 template<
typename _IntType>
54 randint(_IntType __a, _IntType __b)
56 static_assert(is_integral<_IntType>::value &&
sizeof(_IntType) > 1,
57 "argument must be an integer type");
62 return _Dist(__a, __b)(_S_randint_engine());
68 _S_randint_engine().
seed(random_device{}());
74 _S_randint_engine().
seed(__value);
79 _GLIBCXX_END_NAMESPACE_VERSION
83 #endif // _GLIBCXX_EXPERIMENTAL_RANDOM
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...
A model of a linear congruential random number generator.
void seed(result_type __s=default_seed)
Reseeds the linear_congruential_engine random number generator engine sequence to the seed __s...