30#ifndef _GLIBCXX_EXPERIMENTAL_RANDOM
31#define _GLIBCXX_EXPERIMENTAL_RANDOM 1
33#if __cplusplus >= 201402L
38_GLIBCXX_BEGIN_NAMESPACE_VERSION
41inline namespace fundamentals_v2 {
42#define __cpp_lib_experimental_randint 201511
44 inline std::default_random_engine&
47 static thread_local default_random_engine __eng{random_device{}()};
52 template<
typename _IntType>
55 randint(_IntType __a, _IntType __b)
57 static_assert(is_integral<_IntType>::value &&
sizeof(_IntType) > 1,
58 "argument must be an integer type");
59 using _Dist = std::uniform_int_distribution<_IntType>;
63 return _Dist(__a, __b)(_S_randint_engine());
69 _S_randint_engine().
seed(random_device{}());
75 _S_randint_engine().seed(__value);
80_GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.
Namespace for features defined in ISO Technical Specifications.
void seed(result_type __s=default_seed)
Reseeds the linear_congruential_engine random number generator engine sequence to the seed __s.
uint_fast32_t result_type