#
A random_device uniform random bit generator produces nondeterministic random numbers.
2
#
If implementation limitations prevent generating nondeterministic random numbers, the implementation may employ a random number engine.
namespace std { class random_device { public: / types using result_type = unsigned int; / generator characteristics static constexpr result_type min() { return numeric_limits<result_type>::min(); } static constexpr result_type max() { return numeric_limits<result_type>::max(); } / constructors random_device() : random_device(implementation-defined) {} explicit random_device(const string& token); / generating functions result_type operator()(); / property functions double entropy() const noexcept; / no copy functions random_device(const random_device&) = delete; void operator=(const random_device&) = delete; }; }
explicit random_device(const string& token);
Throws: A value of an implementation-defined type derived from exception if the random_device cannot be initialized.
Remarks: The semantics of the token parameter and the token value used by the default constructor are implementation-defined.235
double entropy() const noexcept;
Returns: If the implementation employs a random number engine, returns 0.0.
Otherwise, returns an entropy estimate236 for the random numbers returned by operator(), in the range min() to
result_type operator()();
Returns: A nondeterministic random value, uniformly distributed between min() and max() (inclusive).
It is implementation-defined how these values are generated.
Throws: A value of an implementation-defined type derived from exception if a random number cannot be obtained.
235)235)
The parameter is intended to allow an implementation to differentiate between different sources of randomness.
236)236)
If a device has n states whose respective probabilities are

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant