Date
2025-02-07.22:54:03
Message id
14624

Content

Proposed resolution:

This wording is relative to N5001.

  1. Modify [exec.awaitable] as indicated:
    -5- Let with-await-transform be the exposition-only class template:
    
    namespace std::execution {
      template<class T, class Promise>
        concept has-as-awaitable =                                  // exposition only
          requires (T&& t, Promise& p) {
            { std::forward<T>(t).as_awaitable(p) } -> is-awaitable<Promise&>;
          };
    
      template<class Derived>
        struct with-await-transform {                               // exposition only
          template<class T>
            T&& await_transform(T&& value) noexcept {
              return std::forward<T>(value);
            }
    
          template<has-as-awaitable<Derived> T>
            decltype(auto)auto await_transform(T&& value)
              noexcept(noexcept(std::forward<T>(value).as_awaitable(declval<Derived&>())))
            -> decltype(std::forward<T>(value).as_awaitable(declval<Derived&>())) {
              return std::forward<T>(value).as_awaitable(static_cast<Derived&>(*this));
            }
        };
    }