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 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|