tmp/tmpeks0cs5x/{from.md → to.md}
RENAMED
|
@@ -21,12 +21,12 @@ suitable `operator>>`.
|
|
| 21 |
|
| 22 |
A class `E` that meets the requirements of a uniform random bit
|
| 23 |
generator [[rand.req.urng]] also meets the requirements of a *random
|
| 24 |
number engine* if the expressions shown in [[rand.req.eng]] are valid
|
| 25 |
and have the indicated semantics, and if `E` also meets all other
|
| 26 |
-
requirements of
|
| 27 |
-
|
| 28 |
|
| 29 |
- `T` is the type named by `E`’s associated `result_type`;
|
| 30 |
- `e` is a value of `E`, `v` is an lvalue of `E`, `x` and `y` are
|
| 31 |
(possibly const) values of `E`;
|
| 32 |
- `s` is a value of `T`;
|
|
@@ -44,5 +44,51 @@ where `charT` and `traits` are constrained according to [[strings]] and
|
|
| 44 |
`E` shall meet the *Cpp17CopyConstructible* (
|
| 45 |
[[cpp17.copyconstructible]]) and *Cpp17CopyAssignable* (
|
| 46 |
[[cpp17.copyassignable]]) requirements. These operations shall each be
|
| 47 |
of complexity no worse than 𝑂(\text{size of state}).
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
A class `E` that meets the requirements of a uniform random bit
|
| 23 |
generator [[rand.req.urng]] also meets the requirements of a *random
|
| 24 |
number engine* if the expressions shown in [[rand.req.eng]] are valid
|
| 25 |
and have the indicated semantics, and if `E` also meets all other
|
| 26 |
+
requirements of [[rand.req.eng]]. In [[rand.req.eng]] and throughout
|
| 27 |
+
this subclause:
|
| 28 |
|
| 29 |
- `T` is the type named by `E`’s associated `result_type`;
|
| 30 |
- `e` is a value of `E`, `v` is an lvalue of `E`, `x` and `y` are
|
| 31 |
(possibly const) values of `E`;
|
| 32 |
- `s` is a value of `T`;
|
|
|
|
| 44 |
`E` shall meet the *Cpp17CopyConstructible* (
|
| 45 |
[[cpp17.copyconstructible]]) and *Cpp17CopyAssignable* (
|
| 46 |
[[cpp17.copyassignable]]) requirements. These operations shall each be
|
| 47 |
of complexity no worse than 𝑂(\text{size of state}).
|
| 48 |
|
| 49 |
+
On hosted implementations, the following expressions are well-formed and
|
| 50 |
+
have the specified semantics.
|
| 51 |
+
|
| 52 |
+
``` cpp
|
| 53 |
+
os << x
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
*Effects:* With `os.`*`fmtflags`* set to `ios_base::dec|ios_base::left`
|
| 57 |
+
and the fill character set to the space character, writes to `os` the
|
| 58 |
+
textual representation of `x`’s current state. In the output, adjacent
|
| 59 |
+
numbers are separated by one or more space characters.
|
| 60 |
+
|
| 61 |
+
*Ensures:* The `os.`*`fmtflags`* and fill character are unchanged.
|
| 62 |
+
|
| 63 |
+
*Result:* reference to the type of `os`.
|
| 64 |
+
|
| 65 |
+
*Returns:* `os`.
|
| 66 |
+
|
| 67 |
+
*Complexity:* 𝑂(size of state)
|
| 68 |
+
|
| 69 |
+
``` cpp
|
| 70 |
+
is >> v
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
*Preconditions:* `is` provides a textual representation that was
|
| 74 |
+
previously written using an output stream whose imbued locale was the
|
| 75 |
+
same as that of `is`, and whose type’s template specialization arguments
|
| 76 |
+
`charT` and `traits` were respectively the same as those of `is`.
|
| 77 |
+
|
| 78 |
+
*Effects:* With `is.`*`fmtflags`* set to `ios_base::dec`, sets `v`’s
|
| 79 |
+
state as determined by reading its textual representation from `is`. If
|
| 80 |
+
bad input is encountered, ensures that `v`’s state is unchanged by the
|
| 81 |
+
operation and calls `is.setstate(ios_base::failbit)` (which may throw
|
| 82 |
+
`ios_base::failure` [[iostate.flags]]). If a textual representation
|
| 83 |
+
written via `os << x` was subsequently read via `is >> v`, then `x == v`
|
| 84 |
+
provided that there have been no intervening invocations of `x` or of
|
| 85 |
+
`v`.
|
| 86 |
+
|
| 87 |
+
*Ensures:* The `is.`*`fmtflags`* are unchanged.
|
| 88 |
+
|
| 89 |
+
*Result:* reference to the type of `is`.
|
| 90 |
+
|
| 91 |
+
*Returns:* `is`.
|
| 92 |
+
|
| 93 |
+
*Complexity:* 𝑂(size of state)
|
| 94 |
+
|