Title
execution::set_value/set_error/set_stopped/start should always return void
Status
new
Section
[exec.set.value][exec.set.error] [exec.set.stopped][exec.opstate.start]
Submitter
Jiang An

Created on 2024-08-20.00:00:00 last changed 3 months ago

Messages

Date: 2024-09-18.22:37:26

Proposed resolution:

This wording is relative to N4988.

  1. Modify [exec.set.value] as indicated:

    -1- set_value is a value completion function ([exec.async.ops]). Its associated completion tag is set_value_t. The expression set_value(rcvr, vs...) for a subexpression rcvr and pack of subexpressions vs is ill-formed if rcvr is an lvalue or an rvalue of const type. Otherwise, it is expression-equivalent to MANDATE-NOTHROW(void(rcvr.set_value(vs...))).

  2. Modify [exec.set.error] as indicated:

    -1- set_error is an error completion function ([exec.async.ops]). Its associated completion tag is set_error_t. The expression set_error(rcvr, err) for some subexpressions rcvr and err is ill-formed if rcvr is an lvalue or an rvalue of const type. Otherwise, it is expression-equivalent to MANDATE-NOTHROW(void(rcvr.set_error(err))).

  3. Modify [exec.set.stopped] as indicated:

    -1- set_stopped is a stopped completion function ([exec.async.ops]). Its associated completion tag is set_stopped_t. The expression set_stopped(rcvr) for a subexpression rcvr is ill-formed if rcvr is an lvalue or an rvalue of const type. Otherwise, it is expression-equivalent to MANDATE-NOTHROW(void(rcvr.set_stopped())).

  4. Modify [exec.opstate.start] as indicated:

    -1- The name start denotes a customization point object that starts ([exec.async.ops]) the asynchronous operation associated with the operation state object. For a subexpression op, the expression start(op) is ill-formed if op is an rvalue. Otherwise, it is expression-equivalent to MANDATE-NOTHROW(void(op.start())).

Date: 2024-09-15.00:00:00

[ 2024-09-18; Reflector poll ]

Set priority to 2 after reflector poll. Should require the expressions to have type `void`, rather than just discarding anything that is returned.

Date: 2024-08-20.00:00:00

In editorial issue #7222, it was observed that currently execution::start may have a non-void return value, which possibly interacts with overloaded operator,. But the return value of execution::start doesn't seem used anywhere.

In addition to execution::start, the return values of execution::set_value, execution::set_error, and execution::set_stopped also seem never used, and the return type of these CPOs are always void in stdexec. Perhaps it would be better to specified in the standard that these CPOs always return void.

History
Date User Action Args
2024-09-18 22:37:26adminsetmessages: + msg14385
2024-08-31 13:32:11adminsetmessages: + msg14346
2024-08-20 00:00:00admincreate