30#ifndef _GLIBCXX_EXPERIMENTAL_RANDOM
31#define _GLIBCXX_EXPERIMENTAL_RANDOM 1
35#if __cplusplus >= 201402L
40_GLIBCXX_BEGIN_NAMESPACE_VERSION
42namespace experimental {
43inline namespace fundamentals_v2 {
44#define __cpp_lib_experimental_randint 201511
46 inline std::default_random_engine&
49 static thread_local default_random_engine __eng{random_device{}()};
54 template<
typename _IntType>
57 randint(_IntType __a, _IntType __b)
59 static_assert(is_integral<_IntType>::value &&
sizeof(_IntType) > 1,
60 "argument must be an integer type");
65 return _Dist(__a, __b)(_S_randint_engine());
71 _S_randint_engine().seed(random_device{}());
75 reseed(default_random_engine::result_type __value)
77 _S_randint_engine().seed(__value);
82_GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.
Uniform discrete distribution for random numbers. A discrete random distribution on the range with e...