Skip to content
Open
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
aa8d882
Add debug and static-member-fn support to sequence-sender
kirkshoop Sep 30, 2025
4e37d4d
switch `__seqexpr` to use static-member-fn to customize `subscribe` a…
kirkshoop Sep 30, 2025
fef35d8
add `__well_formed_sequence_sender` constraints to `ignore_all_values…
kirkshoop Sep 30, 2025
f7da526
improve debugging for `transform_each`
kirkshoop Sep 30, 2025
082a9e4
move sequence ERROR structs into exec namespace
kirkshoop Sep 30, 2025
4cca273
add `merge` algorithm for sequence-senders
kirkshoop Sep 30, 2025
ef85ae8
fix bugs in merge and transform_each
kirkshoop Oct 12, 2025
86c2afb
apply PR feedback
kirkshoop Oct 12, 2025
b3ca212
remove requires clause that was preventing diagnosis of failed type c…
kirkshoop Oct 12, 2025
bb09c37
diagnostics improvements for sequence sender
kirkshoop Oct 12, 2025
3f1ba21
add merge_each sequence sender adaptor
kirkshoop Oct 12, 2025
5117f8b
provide aliases for exec::materialize_t and exec::dematerialize_t
kirkshoop Oct 18, 2025
d63efcf
fix compiler error construction in merge
kirkshoop Oct 18, 2025
41a2f09
fix some ordering and error handling issues in merge_each
kirkshoop Oct 18, 2025
28d9367
improve compile errors for sequence senders
kirkshoop Oct 18, 2025
be05244
prevent trailing return types from causing subscribe, get_completion_…
kirkshoop Oct 18, 2025
b1b1614
add the option to specify a scheduler to iterate.
kirkshoop Oct 18, 2025
84b041f
add test_scheduler and marble and notification
kirkshoop Oct 18, 2025
b70a136
Merge branch 'main' into addmerge
ericniebler Oct 19, 2025
da25787
remove windows-only compilation error debug aid that is breaking wind…
kirkshoop Oct 21, 2025
54e46e2
replace static_thread_pool with single_thread_context. static_thread_…
kirkshoop Oct 29, 2025
3229813
Merge branch 'main' into addmerge
ericniebler Oct 29, 2025
8364f1a
clang-format changes
kirkshoop Oct 29, 2025
f58736e
remove _t from concept name
kirkshoop Oct 29, 2025
431c67c
simplify meta expression at the behest of Visual Studio
kirkshoop Oct 29, 2025
825110f
compile time debug changes
kirkshoop Oct 29, 2025
73d3cb0
Merge branch 'addmerge' into add-merge_each
kirkshoop Oct 29, 2025
9c71ef2
fix crash in delays_each_on
kirkshoop Oct 31, 2025
71da7d9
Merge remote-tracking branch 'origin/addmerge' into add-merge_each
kirkshoop Oct 31, 2025
36b00e2
clang-format changes
kirkshoop Oct 31, 2025
3cbf83b
fix bad copy/paste
kirkshoop Oct 31, 2025
ec14797
clang-format changes
kirkshoop Oct 31, 2025
dbd27ac
Merge branch 'add-merge_each' into marbletesting
kirkshoop Oct 31, 2025
09c57f3
update transform_iterate to work with specified scheduler support in …
kirkshoop Nov 1, 2025
6bed02b
silence visual studio unreachable warnings
kirkshoop Nov 1, 2025
9fd303d
fix visual studio errors
kirkshoop Nov 1, 2025
a309693
fixes visual studio compile errors and runtime crashes
kirkshoop Nov 1, 2025
3d93782
fix delays_each_on
kirkshoop Nov 1, 2025
175e734
fix clang19 build
kirkshoop Nov 1, 2025
ff06ec6
Merge remote-tracking branch 'upstream/main' into add-merge_each
kirkshoop Nov 1, 2025
f8841c5
fix bad merge
kirkshoop Nov 1, 2025
0fc8423
Merge branch 'add-merge_each' into marbletesting
kirkshoop Nov 1, 2025
2b48dfe
how did this ever compile?
kirkshoop Nov 1, 2025
ce05c8f
remove checks in multithreaded tests that cause test failures on slow…
kirkshoop Nov 1, 2025
23ab4b8
Merge branch 'add-merge_each' into marbletesting
kirkshoop Nov 1, 2025
850a25c
fixes warnings and errors in clang16
kirkshoop Nov 2, 2025
50d6ce7
get nvhpc compiling
kirkshoop Nov 6, 2025
307ead3
Merge branch 'add-merge_each' into marbletesting
kirkshoop Nov 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improve debugging for transform_each
- add `__well_formed_sequence_sender` constraint
- add `__mexception` overloads for `get_item_types`
- remove constraints that were causing SFINAE that would skip the debug info
  • Loading branch information
kirkshoop committed Sep 30, 2025
commit f7da526ca0fe26bffb9a67ccb8ff804243f90079
113 changes: 82 additions & 31 deletions include/exec/sequence/transform_each.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "../sequence_senders.hpp"

#include "../__detail/__basic_sequence.hpp"
#include "stdexec/__detail/__diagnostics.hpp"
#include "stdexec/__detail/__meta.hpp"

namespace exec {
namespace __transform_each {
Expand All @@ -42,8 +44,6 @@ namespace exec {
__operation_base<_Receiver, _Adaptor>* __op_;

template <class _Item>
requires __callable<_Adaptor&, _Item>
&& __callable<exec::set_next_t, _Receiver&, __call_result_t<_Adaptor&, _Item>>
auto set_next(_Item&& __item) & noexcept(
__nothrow_callable<set_next_t, _Receiver&, __call_result_t<_Adaptor&, _Item>>
&& __nothrow_callable<_Adaptor&, _Item>)
Expand All @@ -57,7 +57,6 @@ namespace exec {
}

template <class _Error>
requires __callable<set_error_t, _Receiver, _Error>
void set_error(_Error&& __error) noexcept {
stdexec::set_error(
static_cast<_Receiver&&>(__op_->__receiver_), static_cast<_Error&&>(__error));
Expand Down Expand Up @@ -121,29 +120,37 @@ namespace exec {
template <class _Item>
struct _WITH_ITEM_SENDER_ { };

template <class _Adaptor, class _Item>
auto __try_call(_Item*) -> stdexec::__mexception<
_NOT_CALLABLE_ADAPTOR_<_Adaptor&>,
_WITH_ITEM_SENDER_<stdexec::__name_of<_Item>>
>;
template <class _Adaptor>
struct __try_adaptor_calls_t {

template <class _Item>
auto operator()(_Item*) -> stdexec::__mexception<
_NOT_CALLABLE_ADAPTOR_<_Adaptor&>,
_WITH_ITEM_SENDER_<stdexec::__name_of<_Item>>
>;

template <class _Adaptor, class _Item>
requires stdexec::__callable<_Adaptor&, _Item>
auto __try_call(_Item*) -> stdexec::__msuccess;
template <class _Item>
requires stdexec::__callable<_Adaptor&, _Item>
auto operator()(_Item*) -> stdexec::__msuccess;

template <class... _Items>
auto operator()(item_types<_Items...>*) -> decltype((
stdexec::__msuccess(), ..., (*this)(static_cast<_Items*>(nullptr))));
};

template <class _Adaptor, class... _Items>
auto __try_calls(item_types<_Items...>*) -> decltype((
stdexec::__msuccess() && ... && __try_call<_Adaptor>(static_cast<_Items*>(nullptr))));
template <class _Adaptor, class _Items>
using __try_adaptor_calls_result_t = __call_result_t<__try_adaptor_calls_t<stdexec::__decay_t<_Adaptor>>, _Items>;

template <class _Adaptor, class _Items>
concept __callabale_adaptor_for = requires(_Items* __items) {
{ __try_calls<stdexec::__decay_t<_Adaptor>>(__items) } -> stdexec::__ok;
concept __callable_adaptor_for = requires(_Items* __items) {
{ __try_adaptor_calls_t<stdexec::__decay_t<_Adaptor>>{}(__items) } -> stdexec::__ok;
};

struct transform_each_t {
template <sender _Sequence, __sender_adaptor_closure _Adaptor>
auto operator()(_Sequence&& __sndr, _Adaptor&& __adaptor) const
noexcept(__nothrow_decay_copyable<_Sequence> && __nothrow_decay_copyable<_Adaptor>) {
noexcept(__nothrow_decay_copyable<_Sequence> && __nothrow_decay_copyable<_Adaptor>)
-> __well_formed_sequence_sender auto {
return make_sequence_expr<transform_each_t>(
static_cast<_Adaptor&&>(__adaptor), static_cast<_Sequence&&>(__sndr));
}
Expand All @@ -155,12 +162,12 @@ namespace exec {
return {{static_cast<_Adaptor&&>(__adaptor)}, {}, {}};
}

template <class _Self, class _Env>
using __completion_sigs_t = __sequence_completion_signatures_of_t<__child_of<_Self>, _Env>;
template <class _Self, class... _Env>
using __completion_sigs_t = __sequence_completion_signatures_of_t<__child_of<_Self>, _Env...>;

template <sender_expr_for<transform_each_t> _Self, class _Env>
template <sender_expr_for<transform_each_t> _Self, class... _Env>
static auto
get_completion_signatures(_Self&&, _Env&&) noexcept -> __completion_sigs_t<_Self, _Env> {
get_completion_signatures(_Self&&, _Env&&...) noexcept -> __completion_sigs_t<_Self, _Env...> {
return {};
}

Expand All @@ -170,11 +177,61 @@ namespace exec {
stdexec::__mbind_front_q<__call_result_t, __data_of<_Self>&>,
stdexec::__munique<stdexec::__q<item_types>>
>,
item_types_of_t<__child_of<_Self>, _Env...>
__item_types_of_t<__child_of<_Self>, _Env...>
>;

template <sender_expr_for<transform_each_t> _Self, class _Env>
static auto get_item_types(_Self&&, _Env&&) noexcept -> __item_types_t<_Self, _Env> {
template<class _Transform>
struct _TRANSFORM_EACH_ADAPTOR_INVOCATION_FAILED_ {};

template <sender_expr_for<transform_each_t> _Self, class... _Env>
requires (!__mvalid<__item_types_t, _Self, _Env...>)
&& __mvalid<__item_types_of_t, __child_of<_Self>, _Env...>
&& (!__callable_adaptor_for<
__data_of<_Self>,
__item_types_of_t<__child_of<_Self>, _Env...>
>)
static auto get_item_types(_Self&&, _Env&&...) noexcept -> __mexception<
_TRANSFORM_EACH_ADAPTOR_INVOCATION_FAILED_<_Self>,
__sequence_sndr::_WITH_SEQUENCE_<__child_of<_Self>>,
_WITH_ENVIRONMENT_<_Env...>,
_WITH_TYPE_<__try_adaptor_calls_result_t<
__data_of<_Self>,
__item_types_of_t<__child_of<_Self>, _Env...>>>>;

template<class _Transform>
struct _TRANSFORM_EACH_ITEM_TYPES_OF_THE_CHILD_ARE_INVALID_ {};

template <sender_expr_for<transform_each_t> _Self, class... _Env>
requires (!__mvalid<__item_types_t, _Self, _Env...>)
&& (!__mvalid<__item_types_of_t, __child_of<_Self>, _Env...>)
static auto get_item_types(_Self&&, _Env&&...) noexcept -> __mexception<
_TRANSFORM_EACH_ITEM_TYPES_OF_THE_CHILD_ARE_INVALID_<_Self>,
__sequence_sndr::_WITH_SEQUENCE_<__child_of<_Self>>,
_WITH_ENVIRONMENT_<_Env...>>;

template<class _Transform>
struct _TRANSFORM_EACH_ITEM_TYPES_CALCULATION_FAILED_ {};

template <sender_expr_for<transform_each_t> _Self, class... _Env>
requires (!__mvalid<__item_types_t, _Self, _Env...>)
&& __mvalid<__item_types_of_t, __child_of<_Self>, _Env...>
&& __callable_adaptor_for<
__data_of<_Self>,
__item_types_of_t<__child_of<_Self>, _Env...>
>
static auto get_item_types(_Self&&, _Env&&...) noexcept -> __mexception<
_TRANSFORM_EACH_ITEM_TYPES_CALCULATION_FAILED_<_Self>,
__sequence_sndr::_WITH_SEQUENCE_<__child_of<_Self>>,
_WITH_ENVIRONMENT_<_Env...>>;

template <sender_expr_for<transform_each_t> _Self, class... _Env>
requires __mvalid<__item_types_t, _Self, _Env...>
&& __mvalid<__item_types_of_t, __child_of<_Self>, _Env...>
&& __callable_adaptor_for<
__data_of<_Self>,
__item_types_of_t<__child_of<_Self>, _Env...>
>
static auto get_item_types(_Self&&, _Env&&...) noexcept -> __item_types_t<_Self, _Env...> {
return {};
}

Expand All @@ -185,12 +242,6 @@ namespace exec {
using __operation_t = __t<__operation<__child_of<_Self>, __id<_Receiver>, __data_of<_Self>>>;

template <sender_expr_for<transform_each_t> _Self, receiver _Receiver>
requires __callabale_adaptor_for<
__data_of<_Self>,
item_types_of_t<__child_of<_Self>, env_of_t<_Receiver>>
>
&& sequence_receiver_of<_Receiver, __item_types_t<_Self, env_of_t<_Receiver>>>
&& sequence_sender_to<__child_of<_Self>, __receiver_t<_Self, _Receiver>>
static auto subscribe(_Self&& __self, _Receiver __rcvr)
noexcept(__nothrow_callable<__sexpr_apply_t, _Self, __subscribe_fn<_Receiver>>)
-> __call_result_t<__sexpr_apply_t, _Self, __subscribe_fn<_Receiver>> {
Expand All @@ -208,4 +259,4 @@ namespace exec {

using __transform_each::transform_each_t;
inline constexpr transform_each_t transform_each{};
} // namespace exec
} // namespace exec