as described in issue #305, enable_sender variable template was an important way to opt in to sender-ness, particularly for types that are awaitable, but only in certain contexts. this functionality was lost during wording review(?) when enable_sender got turned into an exposition-only enable-sender concept.
we should roll back that change.
Proposed resolution
Change [exec.snd.concepts] para 1 as follows:
template<class Sndr>
concept is-sender = // exposition only
derived_from<typename Sndr::sender_concept, sender_t>;
template<class Sndr>
concept enable-sender = // exposition only
is-sender<Sndr> ||
is-awaitable<Sndr, env-promise<empty_env>>; // [exec.awaitable]
+ template<class Sndr>
+ inline constexpr bool enable_sender = enable-sender<Sndr>;
template<class Sndr>
concept sender =
- bool(enable-sender<remove_cvref_t<Sndr>>) &&
+ enable_sender<remove_cvref_t<Sndr>> &&
requires (const remove_cvref_t<Sndr>& sndr) {
{ get_env(sndr) } -> queryable;
} &&
move_constructible<remove_cvref_t<Sndr>> &&
constructible_from<remove_cvref_t<Sndr>, Sndr>;
we also need the standardese permitting users to specialize enable_sender. after [exec.snd.concepts] para 2, add a new paragraph as follows:
- Remarks: Pursuant to [namespace.std], users may specialize
enable_sender to true for cv-unqualified program-defined types that model sender, and false for types that do not. Such specializations shall be usable in constant expressions ([expr.const]) and have type const bool.
as described in issue #305,
enable_sendervariable template was an important way to opt in to sender-ness, particularly for types that are awaitable, but only in certain contexts. this functionality was lost during wording review(?) whenenable_sendergot turned into an exposition-onlyenable-senderconcept.we should roll back that change.
Proposed resolution
Change [exec.snd.concepts] para 1 as follows:
template<class Sndr> concept is-sender = // exposition only derived_from<typename Sndr::sender_concept, sender_t>; template<class Sndr> concept enable-sender = // exposition only is-sender<Sndr> || is-awaitable<Sndr, env-promise<empty_env>>; // [exec.awaitable] + template<class Sndr> + inline constexpr bool enable_sender = enable-sender<Sndr>; template<class Sndr> concept sender = - bool(enable-sender<remove_cvref_t<Sndr>>) && + enable_sender<remove_cvref_t<Sndr>> && requires (const remove_cvref_t<Sndr>& sndr) { { get_env(sndr) } -> queryable; } && move_constructible<remove_cvref_t<Sndr>> && constructible_from<remove_cvref_t<Sndr>, Sndr>;we also need the standardese permitting users to specialize
enable_sender. after [exec.snd.concepts] para 2, add a new paragraph as follows:enable_sendertotruefor cv-unqualified program-defined types that modelsender, andfalsefor types that do not. Such specializations shall be usable in constant expressions ([expr.const]) and have typeconst bool.