Created on 2024-11-10.00:00:00 last changed 3 weeks ago
Proposed resolution:
This wording is relative to N4993.
Add to the end of [exec.general] as indicated:
-?- For a subexpression `expr`, let AS-CONST(expr) be expression-equivalent to
[](const auto& x) noexcept -> const auto& { return x; }(expr)
Modify [exec.get.allocator] as indicated:
-1- `get_allocator` asks a queryable object for its associated allocator.
-2- The name `get_allocator` denotes a query object. For a subexpression `env`, `get_allocator(env)` is expression-equivalent to MANDATE-NOTHROW(as_constAS-CONST(env).query(get_allocator)).
Modify [exec.get.stop.token] as indicated:
-2- The name `get_stop_token` denotes a query object. For a subexpression `env`, `get_stop_token(env)` is expression-equivalent to:
(2.1) — MANDATE-NOTHROW(
as_constAS-CONST(env).query(get_stop_token)) if that expression is well-formed.
Modify [exec.get.env] as indicated:
-1- `execution::get_env` is a customization point object. For a subexpression `o`, `execution::get_env(o)` is expression-equivalent to:
(1.1) — MANDATE-NOTHROW(
as_constAS-CONST(o).get_env()) if that expression is well-formed.
Modify [exec.get.domain] as indicated:
-2- The name `get_domain` denotes a query object. For a subexpression `env`, `get_domain(env)` is expression-equivalent to MANDATE-NOTHROW(
as_constAS-CONST(env).query(get_domain)).
Modify [exec.get.scheduler] as indicated:
-2- The name `get_scheduler` denotes a query object. For a subexpression `env`, `get_scheduler(env)` is expression-equivalent to MANDATE-NOTHROW(
as_constAS-CONST(env).query(get_scheduler)).
Modify [exec.get.delegation.scheduler] as indicated:
-2- The name `get_delegation_scheduler` denotes a query object. For a subexpression `env`, `get_delegation_scheduler(env)` is expression-equivalent to MANDATE-NOTHROW(
as_constAS-CONST(env).query(get_delegation_scheduler)).
Modify [exec.get.fwd.progress] as indicated:
-2- The name `get_forward_progress_guarantee` denotes a query object. For a subexpression `sch`, let `Sch` be `decltype((sch))`. If `Sch` does not satisfy `scheduler`, `get_forward_progress_guarantee` is ill-formed. Otherwise, `get_forward_progress_guarantee(sch)` is expression-equivalent to:
(2.1) — MANDATE-NOTHROW(
as_constAS-CONST(sch).query(get_forward_progress_guarantee)) if that expression is well-formed.
Modify [exec.get.compl.sched] as indicated:
-2- The name `get_completion_scheduler` denotes a query object template. For a subexpression `q`, the expression get_completion_scheduler<completion-tag>(q) is ill-formed if completion-tag is not one of `set_value_t`, `set_error_t`, or `set_stopped_t`. Otherwise, get_completion_scheduler<completion-tag>(q) is expression-equivalent to
MANDATE-NOTHROW(as_constAS-CONST(q).query(get_completion_scheduler<completion-tag>))
The current specification of `std::execution::get_env()` defines `get_env(o)` as `as_const(o).get_env()`. However, the `as_const()` function has a deleted rvalue-taking overload, meaning that you cannot pass temporaries to it.
This means that several uses of `get_env()` which pass expressions which are either potentially rvalues (e.g. in definition of `connect(sndr, rcvr)` it uses the expression `get_env(rcvr)`, but `rcvr` could be, and usually is, a prvalue) or always rvalues (e.g. `scheduler` concept has the expression get_env(schedule(std::forward<Sch>(sch)))). The intent here was that `get_env()` is a function that takes as an argument a const T& and thus allows prvalues to bind to it. We basically just want to require that `get_env()` finds a const-qualified member-function. The use of `as_const()` does not seem to mirror the semantics of a function with a const T& parameter, so I suggest we change it to something else that expresses the intent.History | |||
---|---|---|---|
Date | User | Action | Args |
2024-11-24 18:26:25 | admin | set | messages: + msg14465 |
2024-11-10 00:00:00 | admin | create |