Open
Description
Issue by lucteo
Sunday Nov 28, 2021 at 17:08 GMT
Originally opened as NVIDIA/stdexec#284
Given:
- P2300R2 description of the
set_error()
CPO doesn't make any reference to whetherset_error()
can throw or not (9.4.2). The text implies thatnoexcept
is forwarded to the actual implementation (most probably by the receiver objects) - The receiver concept specification (9.4) defines the
set_error()
CPO asnoexcept
- The
let_error()
specification allows the typeE
to throw in move construct - The
let_error()
implementation example (9.6.4.5) implies thatset_error(E)
can throw (and a subsequentset_error()
is called with the caught exception).
This seems confusing.
The only way that set_error()
can throw inside the operation state is when the error type throws on move.
If the E
type can throw while being moved, then:
- as implementation show, we need a try/catch around the call to
set_error()
- the sender construction can throw (as the error value is moved)
- the operation state can throw when constructed (i.e., when
connect
is called)
Again, the receiver connected to the operation state of let_error()
doesn't allow set_error(E)
to throw
Wouldn't it be better for the paper to specify that all error types are nothow-movable?
The paper has this requirement in several places for other types. Adding this specification will make the implementation simpler and more coherent.