Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ LambdaBodyIndentation: Signature
LineEnding: LF
Macros: [
'STDEXEC_CATCH_FALLTHROUGH= ',
'STDEXEC_MEMFN_DECL(...)=__VA_ARGS__',
'STDEXEC_EXPLICIT_THIS_BEGIN(...)=__VA_ARGS__',
'STDEXEC_EXPLICIT_THIS_END(...)=',
'STDEXEC_ATTRIBUTE(...)=__attribute__((__VA_ARGS__))',
'STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS=[[no_unique_address]]',
'STDEXEC_MISSING_MEMBER(X,Y)=true',
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/ci.gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- "member-function-customization"
- "pull-request/[0-9]+"

concurrency:
Expand Down Expand Up @@ -119,7 +118,6 @@ jobs:
path: /tmp/sccache*.log
compression-level: 9


ci-gpu:
runs-on: ubuntu-latest
name: CI (GPU)
Expand Down
1 change: 1 addition & 0 deletions cmake/Modules/ConfigureTaskflow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ if(STDEXEC_ENABLE_TASKFLOW)
CPM_ARGS
GITHUB_REPOSITORY taskflow/taskflow
GIT_TAG v3.7.0
OPTIONS "TF_BUILD_TESTS OFF"
)
file(GLOB_RECURSE taskflow_pool include/execpools/taskflow/*.hpp)
add_library(taskflow_pool INTERFACE ${taskflowexec_sources})
Expand Down
3 changes: 2 additions & 1 deletion docs/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2371,7 +2371,8 @@ PREDEFINED = __cplusplus=202302L \
"STDEXEC_SYSTEM_CONTEXT_INLINE=inline" \
"STDEXEC_ATTRIBUTE(X)= " \
"STDEXEC_AUTO_RETURN(...)=->decltype(auto){ return __VA_ARGS__; }" \
"STDEXEC_MEMFN_DECL(...)=__VA_ARGS__" \
"STDEXEC_EXPLICIT_THIS_BEGIN(...)=__VA_ARGS__" \
"STDEXEC_EXPLICIT_THIS_END(...)= " \
"STDEXEC_CLANG()=1" \
"STDEXEC_MSVC()=0" \
"STDEXEC_GCC()=0" \
Expand Down
2 changes: 0 additions & 2 deletions examples/algorithms/then.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
// Pull in the reference implementation of P2300:
#include <stdexec/execution.hpp>

using namespace stdexec::tags;

///////////////////////////////////////////////////////////////////////////////
// then algorithm:
template <class R, class F>
Expand Down
4 changes: 3 additions & 1 deletion examples/benchmark/static_thread_pool_old.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,9 +499,11 @@ namespace exec_old {
}

template <stdexec::__decays_to<bulk_sender> Self, class Env>
static auto get_completion_signatures(Self&&, Env&&) -> completion_signatures<Self, Env> {
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this Self&&, Env&&)
-> completion_signatures<Self, Env> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

auto get_env() const noexcept -> stdexec::env_of_t<const Sender&> {
return stdexec::get_env(sndr_);
Expand Down
3 changes: 2 additions & 1 deletion examples/nvexec/maxwell/snr.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,15 @@ namespace nvexec::_strm {

template <ex::__decays_to<sender_t> Self, ex::receiver Receiver>
requires(ex::sender_to<Sender, Receiver>)
static auto connect(Self&& self, Receiver r)
STDEXEC_EXPLICIT_THIS_BEGIN(auto connect)(this Self&& self, Receiver r)
-> nvexec::_strm::repeat_n::operation_state_t<SenderId, Closure, ex::__id<Receiver>> {
return nvexec::_strm::repeat_n::operation_state_t<SenderId, Closure, ex::__id<Receiver>>(
static_cast<Self&&>(self).sender_,
static_cast<Self&&>(self).closure_,
static_cast<Receiver&&>(r),
self.n_);
}
STDEXEC_EXPLICIT_THIS_END(connect)

[[nodiscard]]
auto get_env() const noexcept -> ex::env_of_t<const Sender&> {
Expand Down
4 changes: 3 additions & 1 deletion include/exec/__detail/__basic_sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ namespace exec {
}

template <stdexec::__decays_to<__seqexpr> _Self, class... _Env>
static auto get_completion_signatures(_Self&& __self, _Env&&... __env)
STDEXEC_EXPLICIT_THIS_BEGIN(
auto get_completion_signatures)(this _Self&& __self, _Env&&... __env)
-> decltype(__self.__tag().get_completion_signatures(
static_cast<_Self&&>(__self),
static_cast<_Env&&>(__env)...)) {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

template <stdexec::__decays_to<__seqexpr> _Self, class... _Env>
static auto get_item_types(_Self&& __self, _Env&&... __env)
Expand Down
3 changes: 2 additions & 1 deletion include/exec/any_sender_of.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,10 +1227,11 @@ namespace exec {

template <stdexec::__decays_to_derived_from<any_sender> _Self, class... _Env>
requires(__any::__satisfies_receiver_query<decltype(_ReceiverQueries), _Env...> && ...)
static auto get_completion_signatures(_Self&&, _Env&&...) noexcept
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this _Self&&, _Env&&...) noexcept
-> __sender_base::completion_signatures {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

template <stdexec::receiver_of<_Completions> _Receiver>
auto connect(_Receiver __rcvr) && -> stdexec::connect_result_t<__sender_base, _Receiver> {
Expand Down
23 changes: 16 additions & 7 deletions include/exec/async_scope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,19 @@ namespace exec {
template <__decays_to<__t> _Self, receiver _Receiver>
requires sender_to<__copy_cvref_t<_Self, _Constrained>, _Receiver>
[[nodiscard]]
static auto
connect(_Self&& __self, _Receiver __rcvr) -> __when_empty_op_t<_Self, _Receiver> {
STDEXEC_EXPLICIT_THIS_BEGIN(auto connect)(this _Self&& __self, _Receiver __rcvr)
-> __when_empty_op_t<_Self, _Receiver> {
return __when_empty_op_t<_Self, _Receiver>{
__self.__scope_, static_cast<_Self&&>(__self).__c_, static_cast<_Receiver&&>(__rcvr)};
}
STDEXEC_EXPLICIT_THIS_END(connect)

template <__decays_to<__t> _Self, class... _Env>
static auto get_completion_signatures(_Self&&, _Env&&...)
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this _Self&&, _Env&&...)
-> __completion_signatures_of_t<__copy_cvref_t<_Self, _Constrained>, __env_t<_Env>...> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

const __impl* __scope_;
STDEXEC_ATTRIBUTE(no_unique_address) _Constrained __c_;
Expand Down Expand Up @@ -256,16 +258,19 @@ namespace exec {
template <__decays_to<__t> _Self, receiver _Receiver>
requires sender_to<__copy_cvref_t<_Self, _Constrained>, __nest_receiver_t<_Receiver>>
[[nodiscard]]
static auto connect(_Self&& __self, _Receiver __rcvr) -> __nest_operation_t<_Receiver> {
STDEXEC_EXPLICIT_THIS_BEGIN(auto connect)(this _Self&& __self, _Receiver __rcvr)
-> __nest_operation_t<_Receiver> {
return __nest_operation_t<_Receiver>{
__self.__scope_, static_cast<_Self&&>(__self).__c_, static_cast<_Receiver&&>(__rcvr)};
}
STDEXEC_EXPLICIT_THIS_END(connect)

template <__decays_to<__t> _Self, class... _Env>
static auto get_completion_signatures(_Self&&, _Env&&...)
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this _Self&&, _Env&&...)
-> __completion_signatures_of_t<__copy_cvref_t<_Self, _Constrained>, __env_t<_Env>...> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)
};
};

Expand Down Expand Up @@ -654,15 +659,19 @@ namespace exec {

template <__decays_to<__t> _Self, receiver _Receiver>
requires receiver_of<_Receiver, __completions_t<_Self>>
static auto connect(_Self&& __self, _Receiver __rcvr) -> __future_op_t<_Receiver> {
STDEXEC_EXPLICIT_THIS_BEGIN(auto connect)(this _Self&& __self, _Receiver __rcvr)
-> __future_op_t<_Receiver> {
return __future_op_t<_Receiver>{
static_cast<_Receiver&&>(__rcvr), static_cast<_Self&&>(__self).__state_};
}
STDEXEC_EXPLICIT_THIS_END(connect)

template <__decays_to<__t> _Self, class... _OtherEnv>
static auto get_completion_signatures(_Self&&, _OtherEnv&&...) -> __completions_t<_Self> {
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this _Self&&, _OtherEnv&&...)
-> __completions_t<_Self> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

private:
friend struct async_scope;
Expand Down
4 changes: 3 additions & 1 deletion include/exec/at_coroutine_exit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ namespace exec {
}

template <__same_as<__t> _Self, class... _Env>
static auto get_completion_signatures(_Self&&, _Env&&...) -> __completions_t<_Env...> {
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this _Self&&, _Env&&...)
-> __completions_t<_Env...> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

auto get_env() const noexcept -> env_of_t<_Sender> {
return stdexec::get_env(__sender_);
Expand Down
3 changes: 2 additions & 1 deletion include/exec/create.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace exec {
requires __callable<_Fun, __context<_Receiver, _Args>&>
&& constructible_from<_Fun, __copy_cvref_t<_Self, _Fun>>
&& constructible_from<_Args, __copy_cvref_t<_Self, _Args>>
static auto connect(_Self&& __self, _Receiver __rcvr)
STDEXEC_EXPLICIT_THIS_BEGIN(auto connect)(this _Self&& __self, _Receiver __rcvr)
-> stdexec::__t<__operation<stdexec::__id<_Receiver>, _Fun, _ArgsId>> {
static_assert(__nothrow_callable<_Fun, __context<_Receiver, _Args>&>);
return {
Expand All @@ -80,6 +80,7 @@ namespace exec {
static_cast<_Self&&>(__self).__fun_
};
}
STDEXEC_EXPLICIT_THIS_END(connect)
};
};

Expand Down
10 changes: 7 additions & 3 deletions include/exec/env.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ namespace exec {

template <__decays_to<__sender> _Self, class _Receiver>
requires receiver_of<_Receiver, __completions_t<env_of_t<_Receiver>>>
static constexpr auto connect(_Self&& __self, _Receiver __rcvr)
constexpr STDEXEC_EXPLICIT_THIS_BEGIN(auto connect)(this _Self&& __self, _Receiver __rcvr)
noexcept(std::is_nothrow_move_constructible_v<_Receiver>)
-> __operation_t<_Tag, __default_t<env_of_t<_Receiver>>, _Receiver> {
return {{}, static_cast<_Self&&>(__self).__default_, static_cast<_Receiver&&>(__rcvr)};
}
STDEXEC_EXPLICIT_THIS_END(connect)

template <class _Env>
constexpr auto get_completion_signatures(_Env&&) -> __completions_t<_Env> {
Expand Down Expand Up @@ -165,17 +166,20 @@ namespace exec {
}

template <__decays_to<__t> _Self, class... _Env>
static constexpr auto get_completion_signatures(_Self&&, _Env&&...)
constexpr STDEXEC_EXPLICIT_THIS_BEGIN(
auto get_completion_signatures)(this _Self&&, _Env&&...)
-> completion_signatures_of_t<__copy_cvref_t<_Self, _Sender>, _Env...> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

template <__decays_to<__t> _Self, class _Receiver>
requires sender_in<__copy_cvref_t<_Self, _Sender>, env_of_t<_Receiver>>
static constexpr auto connect(_Self&& __self, _Receiver __rcvr)
constexpr STDEXEC_EXPLICIT_THIS_BEGIN(auto connect)(this _Self&& __self, _Receiver __rcvr)
-> connect_result_t<__copy_cvref_t<_Self, _Sender>, _Receiver> {
return stdexec::connect(std::forward<_Self>(__self).__sndr_, std::move(__rcvr));
}
STDEXEC_EXPLICIT_THIS_END(connect)
};
};

Expand Down
12 changes: 8 additions & 4 deletions include/exec/finally.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,24 +270,28 @@ namespace exec {
}

template <__decays_to<__t> _Self, class _Rec>
static auto connect(_Self&& __self, _Rec&& __receiver) noexcept -> __op_t<_Self, _Rec> {
STDEXEC_EXPLICIT_THIS_BEGIN(auto connect)(this _Self&& __self, _Rec&& __receiver) noexcept
-> __op_t<_Self, _Rec> {
return {
static_cast<_Self&&>(__self).__initial_sndr_,
static_cast<_Self&&>(__self).__final_sndr_,
static_cast<_Rec&&>(__receiver)};
}
STDEXEC_EXPLICIT_THIS_END(connect)

template <__decays_to<__t> _Self, class... _Env>
static auto get_completion_signatures(_Self&&, _Env&&...) noexcept
STDEXEC_EXPLICIT_THIS_BEGIN(
auto get_completion_signatures)(this _Self&&, _Env&&...) noexcept
-> __completion_signatures_t<__copy_cvref_t<_Self, _InitialSender>, _FinalSender, _Env...> {
return {};
}

template <__decays_to<__t> _Self, class... _Env>
requires(!__decay_copyable<__copy_cvref_t<_Self, _FinalSender>>)
static auto get_completion_signatures(_Self&&, _Env&&...) noexcept {
STDEXEC_EXPLICIT_THIS_BEGIN(
auto get_completion_signatures)(this _Self&&, _Env&&...) noexcept {
return _ERROR_<_SENDER_TYPE_IS_NOT_COPYABLE_, _WITH_SENDER_<_FinalSender>>{};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)
};
};

Expand Down
9 changes: 5 additions & 4 deletions include/exec/fork_join.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ namespace exec {
const Variant* _results_;
};

template <class _Self, class... _Env>
template <class... _Env>
STDEXEC_ATTRIBUTE(host, device)
static auto get_completion_signatures(_Self&&, _Env&&...) noexcept {
auto get_completion_signatures(_Env&&...) const noexcept {
return stdexec::__mapply<stdexec::__qq<_cache_sndr_completions_t>, Variant>{};
}

Expand Down Expand Up @@ -255,7 +255,7 @@ namespace exec {

template <class Self, class... Env>
STDEXEC_ATTRIBUTE(host, device)
static auto get_completion_signatures(Self&&, Env&&...) noexcept {
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this Self&&, Env&&...) noexcept {
using namespace stdexec;
using _domain_t = __detail::__try_completion_domain_of_t<set_value_t, Sndr, Env...>;
using _child_t = __copy_cvref_t<Self, Sndr>;
Expand All @@ -271,9 +271,10 @@ namespace exec {
>();
} else {
using _sndr_t = _when_all_sndr_t<_child_completions_t, _closures_t, _domain_t>;
return completion_signatures_of_t<_sndr_t, __fwd_env_t<Env>...>{};
return __completion_signatures_of_t<_sndr_t, __fwd_env_t<Env>...>{};
}
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

template <class Rcvr>
STDEXEC_ATTRIBUTE(host, device)
Expand Down
23 changes: 13 additions & 10 deletions include/exec/libdispatch_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,27 +280,30 @@ namespace exec {

template <stdexec::__decays_to<__t> Self, stdexec::receiver Receiver>
requires stdexec::receiver_of<Receiver, __completions_t<Self, stdexec::env_of_t<Receiver>>>
static bulk_op_state_t<Self, Receiver>
connect(Self &&self, Receiver rcvr) noexcept(stdexec::__nothrow_constructible_from<
bulk_op_state_t<Self, Receiver>,
libdispatch_queue &,
Shape,
Fun,
Sender,
Receiver
>) {
STDEXEC_EXPLICIT_THIS_BEGIN(auto connect)(this Self &&self, Receiver rcvr)
noexcept(stdexec::__nothrow_constructible_from<
bulk_op_state_t<Self, Receiver>,
libdispatch_queue &,
Shape,
Fun,
Sender,
Receiver
>) -> bulk_op_state_t<Self, Receiver> {
return bulk_op_state_t<Self, Receiver>{
self.queue_,
self.shape_,
self.fun_,
(std::forward<Self>(self)).sndr_,
(std::forward<Receiver>(rcvr))};
}
STDEXEC_EXPLICIT_THIS_END(connect)

template <stdexec::__decays_to<__t> Self, class... Env>
static auto get_completion_signatures(Self &&, Env &&...) -> __completions_t<Self, Env...> {
STDEXEC_EXPLICIT_THIS_BEGIN(auto get_completion_signatures)(this Self &&, Env &&...)
-> __completions_t<Self, Env...> {
return {};
}
STDEXEC_EXPLICIT_THIS_END(get_completion_signatures)

auto get_env() const noexcept -> stdexec::env_of_t<const Sender &> {
return stdexec::get_env(sndr_);
Expand Down
Loading
Loading