29 #ifndef _GLIBCXX_EXPERIMENTAL_RANDOM
30 #define _GLIBCXX_EXPERIMENTAL_RANDOM 1
35 namespace experimental {
36 inline namespace fundamentals_v2 {
37 _GLIBCXX_BEGIN_NAMESPACE_VERSION
39 #define __cpp_lib_experimental_randint 201511
44 static thread_local default_random_engine __eng{random_device{}()};
49 template<
typename _IntType>
51 randint(_IntType __a, _IntType __b)
53 static_assert(is_integral<_IntType>::value &&
sizeof(_IntType) > 1,
54 "argument must be an integer type");
56 static thread_local _Dist __dist;
57 return __dist(_S_randint_engine(),
typename _Dist::param_type{__a, __b});
63 _S_randint_engine().
seed(random_device{}());
69 _S_randint_engine().
seed(__value);
72 _GLIBCXX_END_NAMESPACE_VERSION
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...