A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../numeric/../named_req/UniformRandomBitGenerator.html below:

C++ named requirements: UniformRandomBitGenerator (since C++11)

A uniform random bit generator is a function object returning unsigned integer values such that each value in the range of possible results has (ideally) equal probability.

Uniform random bit generators are not intended to be used as random number generators: they are used as the source of random bits (generated in bulk, for efficiency). Any uniform random bit generator may be plugged into any random number distribution in order to obtain a random number (formally, a random variate).

[edit] Requirements

The type G satisfies UniformRandomBitGenerator if

Given g, a value of type G, all following conditions are satisfied:

(until C++20)  Expression  Type Requirements G::min() G::result_type  G::max() G::result_type g() G::result_type [edit] Notes

All RandomNumberEngines satisfy this requirement.

[edit] Standard library

The following standard library facilities expect a UniformRandomBitGenerator type.

The following standard library facilities satisfy UniformRandomBitGenerator without additionally satisfying RandomNumberEngine:

non-deterministic random number generator using hardware entropy source
(class) [edit] [edit] Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior LWG 2154
(P0898R3) C++11 it was unclear whether G::min() and G::max()
are required to be constant expressions[1] required
  1. ↑ The time complexity requirement for these expressions were “compile-time” before C++20. The wording is ambiguous, as “compile-time time complexity” can be interpreted as both “can be evaluated in compile-time” and “the time complexity can be determined in compile-time”.
[edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4