Commit daf9a01
committed
just: Connect Can Throw
A just sender that isn't nullary contains one or more objects. These
objects are transmitted thereinto by the sender factory therefor. Since
copying and moving objects can throw the just sender factory can also
throw (this is demonstrated by the unit test added by this commit).
In order to be useful a sender must be connected with a receiver to form
an operation state. Since the just operation does not yield the objects
passed to the sender factory therefor until the operation has been
started it is clear those objects must in turn be transmitted from the
sender to the operation state at connect time. If initially providing
those objects can throw then so too can propagating them from the sender
to the operation state. That is to say that not only can the just sender
factory throw but so too can connecting a just sender with a receiver.
Before this commit if a just sender was connected, and one of the move
operations involved therein threw an exception, the program would
terminate due to the fact the exception would attempt to pass through a
constructor marked noexcept. The code involved (changed by this commit)
attempted to accurately reflect the noexcept-ness of the operations
involved by checking:
__noexcept_of<__sexpr_impl<__tag_t>::get_state, _Sexpr, _Receiver&>
However this merely checks if the evaluation of some function throws an
exception. In the case wherein a just sender is being connected the
evaluation does not throw and therefore the above expression correctly
yields true. The function is not merely invoked however, the value
returned thereby is used to populate a data member in the constructor
initializer list. In the instance of just the invocation yields an
rvalue reference and therefore a move operation must occur, one which
may throw an exception. To account for this the noexcept check must be:
noexcept(__state_t(__sexpr_impl<__tag_t>::get_state(static_cast<_Sexpr&&>(__sndr), __rcvr_)))
Which is what it is changed to by this commit.1 parent 9bce1ba commit daf9a01
2 files changed
Lines changed: 56 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
124 | 128 | | |
125 | 129 | | |
126 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
127 | 182 | | |
0 commit comments