Skip to content

within algorithm from P3955#288

Merged
dietmarkuehl merged 14 commits into
mainfrom
within-algo
Jul 14, 2026
Merged

within algorithm from P3955#288
dietmarkuehl merged 14 commits into
mainfrom
within-algo

Conversation

@lucteo

@lucteo lucteo commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Also add additional concepts from the paper:

  • enter_scope_sender
  • enter_scope_sender_in
  • exit_scope_sender
  • exit_scope_sender_in
  • exit_scope_sender_of_t

Add utilities:

  • completion_storage -- allows storing the completions of an async operation to be used later.
  • elide -- helper to elide move ctor; useful for constructing operation states

Also add additional concepts from the paper:
- `enter_scope_sender`
- `enter_scope_sender_in`
- `exit_scope_sender`
- `exit_scope_sender_in`
- `exit_scope_sender_of_t`

Add utilities:
- `completion_storage` -- allows storing the completions of an async
operation to be used later.
- `elide` -- helper to elide move ctor; useful for constructing
operation states
lucteo added 8 commits July 12, 2026 11:42
- apply clang format
- remove global qualification of class name
- remove recursive include in `exit_scope_sender_in.hpp`
Fix issue when checking nothrow by connecting to the wrong receiver.
- Storing a cvref-removed receiver in `within` state object
- Initialize the receiver before the operation state -- this caused UB
- add appropriate headers in `exec-within.test.cpp`
- remove unused variables from test
@coveralls

coveralls commented Jul 13, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 93.858% (+0.3%) from 93.571% — within-algo into main

@dietmarkuehl dietmarkuehl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that I understand what within actually does (I should read the paper). There are a few comments which would be cool to address: in particular I think the single sender tools already exist and some of the other tools seem useful otherwise, too.

Comment thread include/beman/execution/detail/completion_storage.hpp Outdated
Comment thread include/beman/execution/detail/completion_storage.hpp Outdated
Comment thread include/beman/execution/detail/completion_storage.hpp Outdated
Comment thread include/beman/execution/detail/elide.hpp Outdated
Comment thread include/beman/execution/detail/exit_scope_sender_in.hpp Outdated
Comment thread include/beman/execution/detail/exit_scope_sender_in.hpp Outdated
Comment on lines +35 to +38
template <typename Sig>
inline constexpr bool is_value_completion_sig = false;
template <typename... Args>
inline constexpr bool is_value_completion_sig<::beman::execution::set_value_t(Args...)> = true;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is something like that in include/beman/execution/detail/completion_signature.hpp: is_set_value. It isn't a bool variable template, though. The specialization is certainly needed just once and maybe its use should be unified.

Comment on lines +43 to +55
template <typename... Sigs>
struct single_value_sender;

template <typename T, typename... Rest>
requires(!(::beman::execution::detail::is_value_completion_sig<Rest> || ...))
struct single_value_sender<::beman::execution::set_value_t(T), Rest...> {
using type = T;
};

template <typename First, typename... Rest>
requires(!::beman::execution::detail::is_value_completion_sig<First>)
struct single_value_sender<First, Rest...> : ::beman::execution::detail::single_value_sender<Rest...> {};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a concept single_sender which could probably do some of the work. It seems, single_value_sender also extracts the argument type, though.

single_sender is an exposition-only concept from the specification. It actually uses single_sender_value_type which is an exposition-only type alias also from the specification. I'd think these can be used directly.

Comment thread include/beman/execution/detail/within.hpp Outdated
@dietmarkuehl dietmarkuehl merged commit 542f775 into main Jul 14, 2026
38 checks passed
@dietmarkuehl dietmarkuehl deleted the within-algo branch July 14, 2026 20:21
dietmarkuehl pushed a commit that referenced this pull request Jul 14, 2026
According to the feedback received on #288
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants