Skip to content

Commit

Permalink
Add Eric's comments from the PR about __i and __basic_sender and
Browse files Browse the repository at this point in the history
`__sexpr`.
  • Loading branch information
BenFrantzDale committed Oct 25, 2024
1 parent ee22cea commit 05224d5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 5 additions & 3 deletions include/stdexec/__detail/__basic_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class...>
struct __basic_sender {
// See MAINTAINERS.md#class-template-parameters for `__id` and `__t`.
Expand All @@ -510,7 +510,9 @@ namespace stdexec {
};

//! A struct template to aid in creating senders.
//! A `__sexpr<Desc>`
//! 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 <auto _DescriptorFn, class = __anon>
struct __sexpr {
using sender_concept = sender_t;
Expand Down
12 changes: 9 additions & 3 deletions include/stdexec/__detail/__meta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,15 @@ namespace stdexec {
template <class... _Args>
concept _Ok = (STDEXEC_IS_SAME(__ok_t<_Args>, __msuccess) && ...);

//! If both are true:
//! Then __i<true, true>::__g<F, Args...> is an alias for F<Args...>
//! and __i<true, true>::__f<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 <bool _ArgsOK, bool _FnOK = true>
struct __i;

Expand Down

0 comments on commit 05224d5

Please sign in to comment.