From 05224d55b4ddb51aa49870d17981da6c35fbd44a Mon Sep 17 00:00:00 2001 From: Ben FrantzDale Date: Thu, 24 Oct 2024 13:30:48 -0400 Subject: [PATCH] Add Eric's comments from the PR about `__i` and `__basic_sender` and `__sexpr`. --- include/stdexec/__detail/__basic_sender.hpp | 8 +++++--- include/stdexec/__detail/__meta.hpp | 12 +++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/stdexec/__detail/__basic_sender.hpp b/include/stdexec/__detail/__basic_sender.hpp index 965264534..475ea7158 100644 --- a/include/stdexec/__detail/__basic_sender.hpp +++ b/include/stdexec/__detail/__basic_sender.hpp @@ -500,8 +500,8 @@ namespace stdexec { using __get_attrs_fn = __result_of<__detail::__drop_front, __mtypeof<__sexpr_impl<_Tag>::get_attrs>>; - ////////////////////////////////////////////////////////////////////////////////////////////////// - // __basic_sender + //! A dummy type used only for diagnostic purposes. + //! See `__sexpr` for the implementation of P2300's _`basic-sender`_. template struct __basic_sender { // See MAINTAINERS.md#class-template-parameters for `__id` and `__t`. @@ -510,7 +510,9 @@ namespace stdexec { }; //! A struct template to aid in creating senders. - //! A `__sexpr` + //! This struct closely resembles P2300's [_`basic-sender`_](https://eel.is/c++draft/exec#snd.expos-24), + //! but is not an exact implementation. + //! Note: The struct named `__basic_sender` is just a dummy type and is also not _`basic-sender`_. template struct __sexpr { using sender_concept = sender_t; diff --git a/include/stdexec/__detail/__meta.hpp b/include/stdexec/__detail/__meta.hpp index d0479708d..42137ce17 100644 --- a/include/stdexec/__detail/__meta.hpp +++ b/include/stdexec/__detail/__meta.hpp @@ -329,9 +329,15 @@ namespace stdexec { template concept _Ok = (STDEXEC_IS_SAME(__ok_t<_Args>, __msuccess) && ...); - //! If both are true: - //! Then __i::__g is an alias for F - //! and __i::__f is an alias for F. + //! The struct `__i` is the implementation of P2300's + //! [_`META-APPLY`_](https://eel.is/c++draft/exec#util.cmplsig-5). + //! > [Note [1](https://eel.is/c++draft/exec#util.cmplsig-note-1):  + //! > The purpose of META-APPLY is to make it valid to use non-variadic + //! > templates as Variant and Tuple arguments to gather-signatures. — end note] + //! In addition to avoiding the dreaded "pack expanded into non-pack argument" error, + //! it is part of the meta-error propagation mechanism. if any of the argument types + //! are a specialization of `_ERROR_`, `__i` will short-circuit and return the error. + //! `__minvoke` and `__meval` are implemented in terms of `__i`. template struct __i;