4205. let_[*].transform_env is specified in terms of the let_* sender itself instead of its child

Section: 33.9.12.8 [exec.let] Status: Ready Submitter: Eric Niebler Opened: 2025-02-04 Last modified: 2025-02-11

Priority: 1

View other active issues in [exec.let].

View all other issues in [exec.let].

View all issues with Ready status.

Discussion:

Imported from cplusplus/sender-receiver #319.

33.9.12.8 [exec.let] para 13 reads:

13. Let sndr and env be subexpressions, and let Sndr be decltype((sndr)). If sender-for<Sndr, decayed-typeof<let-cpo>> is false, then the expression let-cpo.transform_env(sndr, env) is ill-formed. Otherwise, it is equal to JOIN-ENV(let-env(sndr), FWD-ENV(env)).
The sender passed to let-env here should be the child of sndr.

[2025-02-07; Reflector poll]

Set priority to 1 after reflector poll.

"We seem to be missing a guarantee that auto [_,_,child] = sndr; works. We guarantee that it can be used in a structured binding, but not that it must work with a size of three."

[Hagenberg 2025-02-10; move to Ready]

Proposed resolution:

This wording is relative to N5001.

  1. Modify 33.9.12.8 [exec.let] as indicated:
    -13- Let sndr and env be subexpressions, and let Sndr be decltype((sndr)). If sender-for<Sndr, decayed-typeof<let-cpo>> is false, then the expression let-cpo.transform_env(sndr, env) is ill-formed. Otherwise, it is equal to JOIN-ENV(let-env(sndr), FWD-ENV(env)).
      auto& [_, _, child] = sndr;
      return JOIN-ENV(let-env(child), FWD-ENV(env));