From Jason Turner

[rand.req.urng]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpz97zkyhb/{from.md → to.md} +22 -6
tmp/tmpz97zkyhb/{from.md → to.md} RENAMED
@@ -5,13 +5,29 @@ returning unsigned integer values such that each value in the range of
5
  possible results has (ideally) equal probability of being returned.
6
 
7
  [*Note 1*: The degree to which `g`’s results approximate the ideal is
8
  often determined statistically. — *end note*]
9
 
10
- A class `G` satisfies the requirements of a *uniform random bit
11
- generator* if the expressions shown in Table 
12
- [[tab:UniformRandomBitGenerator]] are valid and have the indicated
13
- semantics, and if `G` also satisfies all other requirements of this
14
- section [[rand.req.urng]]. In that Table and throughout this section:
 
 
 
 
 
15
 
16
- The following relation shall hold: `G::min() < G::max()`.
 
 
 
 
 
 
 
 
 
 
 
17
 
 
5
  possible results has (ideally) equal probability of being returned.
6
 
7
  [*Note 1*: The degree to which `g`’s results approximate the ideal is
8
  often determined statistically. — *end note*]
9
 
10
+ ``` cpp
11
+ template<class G>
12
+ concept uniform_random_bit_generator =
13
+ invocable<G&> && unsigned_integral<invoke_result_t<G&>> &&
14
+ requires {
15
+ { G::min() } -> same_as<invoke_result_t<G&>>;
16
+ { G::max() } -> same_as<invoke_result_t<G&>>;
17
+ requires bool_constant<(G::min() < G::max())>::value;
18
+ };
19
+ ```
20
 
21
+ Let `g` be an object of type `G`. `G` models
22
+ `uniform_random_bit_generator` only if
23
+
24
+ - `G::min() <= g()`,
25
+ - `g() <= G::max()`, and
26
+ - `g()` has amortized constant complexity.
27
+
28
+ A class `G` meets the *uniform random bit generator* requirements if `G`
29
+ models `uniform_random_bit_generator`, `invoke_result_t<G&>` is an
30
+ unsigned integer type [[basic.fundamental]], and `G` provides a nested
31
+ *typedef-name* `result_type` that denotes the same type as
32
+ `invoke_result_t<G&>`.
33