This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4344. affine_on has no specification for the default

Section: 33.13.3 [exec.affine.on] Status: New Submitter: Dietmar Kühl Opened: 2025-09-01 Last modified: 2025-09-01

Priority: Not Prioritized

View other active issues in [exec.affine.on].

View all other issues in [exec.affine.on].

View all issues with New status.

Discussion:

The wording of affine_on doesnt have a specification for the default implementation. For other algorithms the default implementation is specified.

The intention for affine_on was to all optimisation/customisation in a way reducing the necessary scheduling: if the implementation can determine if a sender completed already on the correct execution agent it should be allowed to avoid scheduling. A specification should provide enough lattitude to allow that.

Proposed resolution:

Add a new paragraph to the specification of affine_on in 33.13.3 [exec.affine.on] providing a specification for the default implementation:

-6- Let sndr and env be subexpressions such that Sndr is decltype((sndr)). If sender-for<Sndr, affine_on_t> is false, then the expression affine_on.transform_sender(sndr, env) is ill-formed; otherwise, it is equivalent to:

  
auto [_, sch, child] = sndr;
return transform_sender(
  query-with-default(get_domain, sch, default_domain()),
  continues_on(std::move(child), std::move(sch)));

except that sch is only evaluated once.