From Jason Turner

[rand.req.dist]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpqa369h6l/{from.md → to.md} +40 -5
tmp/tmpqa369h6l/{from.md → to.md} RENAMED
@@ -16,12 +16,12 @@ P(zᵢ |{`p`}), to denote a distribution’s parameters `p` taken as a
16
  whole.
17
 
18
  A class `D` meets the requirements of a *random number distribution* if
19
  the expressions shown in [[rand.req.dist]] are valid and have the
20
  indicated semantics, and if `D` and its associated types also meet all
21
- other requirements of this subclause [[rand.req.dist]]. In that Table
22
- and throughout this subclause,
23
 
24
  - `T` is the type named by `D`’s associated `result_type`;
25
  - `P` is the type named by `D`’s associated `param_type`;
26
  - `d` is a value of `D`, and `x` and `y` are (possibly const) values of
27
  `D`;
@@ -53,13 +53,12 @@ representation is restored into the same or a different object `y` of
53
  the same type using `is >> y`, repeated invocations of `y(g)` shall
54
  produce the same sequence of numbers as would repeated invocations of
55
  `x(g)`.
56
 
57
  It is unspecified whether `D::param_type` is declared as a (nested)
58
- `class` or via a `typedef`. In this subclause [[rand]], declarations of
59
- `D::param_type` are in the form of `typedef`s for convenience of
60
- exposition only.
61
 
62
  `P` shall meet the *Cpp17CopyConstructible* (
63
  [[cpp17.copyconstructible]]), *Cpp17CopyAssignable* (
64
  [[cpp17.copyassignable]]), and *Cpp17EqualityComparable* (
65
  [[cpp17.equalitycomparable]]) requirements.
@@ -76,5 +75,41 @@ the identical name, type, and semantics.
76
 
77
  ``` cpp
78
  using distribution_type = D;
79
  ```
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  whole.
17
 
18
  A class `D` meets the requirements of a *random number distribution* if
19
  the expressions shown in [[rand.req.dist]] are valid and have the
20
  indicated semantics, and if `D` and its associated types also meet all
21
+ other requirements of [[rand.req.dist]]. In [[rand.req.dist]] and
22
+ throughout this subclause,
23
 
24
  - `T` is the type named by `D`’s associated `result_type`;
25
  - `P` is the type named by `D`’s associated `param_type`;
26
  - `d` is a value of `D`, and `x` and `y` are (possibly const) values of
27
  `D`;
 
53
  the same type using `is >> y`, repeated invocations of `y(g)` shall
54
  produce the same sequence of numbers as would repeated invocations of
55
  `x(g)`.
56
 
57
  It is unspecified whether `D::param_type` is declared as a (nested)
58
+ `class` or via a `typedef`. In [[rand]], declarations of `D::param_type`
59
+ are in the form of `typedef`s for convenience of exposition only.
 
60
 
61
  `P` shall meet the *Cpp17CopyConstructible* (
62
  [[cpp17.copyconstructible]]), *Cpp17CopyAssignable* (
63
  [[cpp17.copyassignable]]), and *Cpp17EqualityComparable* (
64
  [[cpp17.equalitycomparable]]) requirements.
 
75
 
76
  ``` cpp
77
  using distribution_type = D;
78
  ```
79
 
80
+ On hosted implementations, the following expressions are well-formed and
81
+ have the specified semantics.
82
+
83
+ ``` cpp
84
+ os << x
85
+ ```
86
+
87
+ *Effects:* Writes to `os` a textual representation for the parameters
88
+ and the additional internal data of `x`.
89
+
90
+ *Ensures:* The `os.`*`fmtflags`* and fill character are unchanged.
91
+
92
+ *Result:* reference to the type of `os`.
93
+
94
+ *Returns:* `os`.
95
+
96
+ ``` cpp
97
+ is >> d
98
+ ```
99
+
100
+ *Preconditions:* `is` provides a textual representation that was
101
+ previously written using an `os` whose imbued locale and whose type’s
102
+ template specialization arguments `charT` and `traits` were the same as
103
+ those of `is`.
104
+
105
+ *Effects:* Restores from `is` the parameters and additional internal
106
+ data of the lvalue `d`. If bad input is encountered, ensures that `d` is
107
+ unchanged by the operation and calls `is.setstate(ios_base::failbit)`
108
+ (which may throw `ios_base::failure` [[iostate.flags]]).
109
+
110
+ *Ensures:* The `is.`*`fmtflags`* are unchanged.
111
+
112
+ *Result:* reference to the type of `is`.
113
+
114
+ *Returns:* `is`.
115
+