From 93c41990f72d60401db09ebbd2b1684a11183987 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Thu, 19 Sep 2024 17:44:02 -0700 Subject: [PATCH] reformat everything with clang-format-18 --- include/exec/__detail/__basic_sequence.hpp | 6 ++-- include/exec/__detail/__bwos_lifo_queue.hpp | 6 ++-- include/exec/__detail/__numa.hpp | 6 ++++ include/exec/any_sender_of.hpp | 12 +++---- include/exec/async_scope.hpp | 17 ++++++---- include/exec/at_coroutine_exit.hpp | 8 ++--- include/exec/create.hpp | 2 +- .../linux/__detail/memory_mapped_region.hpp | 4 +-- .../linux/__detail/safe_file_descriptor.hpp | 4 +-- include/exec/linux/io_uring_context.hpp | 14 ++++---- include/exec/materialize.hpp | 4 +-- include/exec/on_coro_disposition.hpp | 4 +-- include/exec/repeat_effect_until.hpp | 6 ++-- include/exec/repeat_n.hpp | 9 +++-- include/exec/sequence/any_sequence_of.hpp | 2 +- include/exec/sequence/ignore_all_values.hpp | 2 +- include/exec/sequence/transform_each.hpp | 10 +++--- include/exec/start_now.hpp | 5 ++- include/exec/static_thread_pool.hpp | 16 ++++----- include/exec/task.hpp | 8 ++--- include/exec/timed_thread_scheduler.hpp | 34 +++++++++---------- include/exec/when_any.hpp | 6 ++-- include/stdexec/__detail/__as_awaitable.hpp | 6 ++-- include/stdexec/__detail/__basic_sender.hpp | 19 ++++++----- .../__detail/__completion_signatures.hpp | 3 +- include/stdexec/__detail/__concepts.hpp | 4 +-- include/stdexec/__detail/__debug.hpp | 4 +-- include/stdexec/__detail/__ensure_started.hpp | 3 +- include/stdexec/__detail/__env.hpp | 20 ++++++----- .../stdexec/__detail/__inline_scheduler.hpp | 3 +- include/stdexec/__detail/__intrusive_ptr.hpp | 8 ++--- .../stdexec/__detail/__intrusive_queue.hpp | 6 ++-- .../stdexec/__detail/__intrusive_slist.hpp | 6 ++-- include/stdexec/__detail/__let.hpp | 6 ++-- .../stdexec/__detail/__manual_lifetime.hpp | 5 ++- include/stdexec/__detail/__meta.hpp | 17 +++++----- include/stdexec/__detail/__on.hpp | 2 +- include/stdexec/__detail/__optional.hpp | 3 +- include/stdexec/__detail/__read_env.hpp | 7 ++-- include/stdexec/__detail/__receivers.hpp | 2 +- include/stdexec/__detail/__run_loop.hpp | 4 +-- include/stdexec/__detail/__schedulers.hpp | 3 +- include/stdexec/__detail/__senders.hpp | 7 ++-- include/stdexec/__detail/__shared.hpp | 2 +- include/stdexec/__detail/__sync_wait.hpp | 10 +++--- .../__transform_completion_signatures.hpp | 25 ++++++-------- include/stdexec/__detail/__tuple.hpp | 10 +++--- include/stdexec/__detail/__type_traits.hpp | 20 +++++------ include/stdexec/__detail/__utility.hpp | 3 +- include/stdexec/__detail/__variant.hpp | 7 ++-- include/stdexec/functional.hpp | 9 ++--- include/stdexec/stop_token.hpp | 9 +++-- 52 files changed, 212 insertions(+), 206 deletions(-) diff --git a/include/exec/__detail/__basic_sequence.hpp b/include/exec/__detail/__basic_sequence.hpp index 5595a2f3b..9931a2f60 100644 --- a/include/exec/__detail/__basic_sequence.hpp +++ b/include/exec/__detail/__basic_sequence.hpp @@ -51,9 +51,9 @@ namespace exec { STDEXEC_ATTRIBUTE((host, device)) explicit __seqexpr(_Tag, _Data&& __data, _Child&&... __child) : __impl_(stdexec::__detail::__captures( - _Tag(), - static_cast<_Data&&>(__data), - static_cast<_Child&&>(__child)...)) { + _Tag(), + static_cast<_Data&&>(__data), + static_cast<_Child&&>(__child)...)) { } template _Self = __seqexpr> diff --git a/include/exec/__detail/__bwos_lifo_queue.hpp b/include/exec/__detail/__bwos_lifo_queue.hpp index 149b5d648..56cb7aaea 100644 --- a/include/exec/__detail/__bwos_lifo_queue.hpp +++ b/include/exec/__detail/__bwos_lifo_queue.hpp @@ -148,9 +148,9 @@ namespace exec::bwos { std::size_t block_size, Allocator allocator) : blocks_( - std::max(static_cast(2), std::bit_ceil(num_blocks)), - block_type(block_size, allocator), - allocator_of_t(allocator)) + std::max(static_cast(2), std::bit_ceil(num_blocks)), + block_type(block_size, allocator), + allocator_of_t(allocator)) , mask_(blocks_.size() - 1) { blocks_[owner_block_.load()].reclaim(); } diff --git a/include/exec/__detail/__numa.hpp b/include/exec/__detail/__numa.hpp index 7c4022096..c44fb7141 100644 --- a/include/exec/__detail/__numa.hpp +++ b/include/exec/__detail/__numa.hpp @@ -83,6 +83,7 @@ namespace exec { T{static_cast(*reinterpret_cast(other->buf))}; } } + // copy static auto _copy(_storage* self, const _storage* other) noexcept -> void { if constexpr (!_is_small::value) { @@ -91,6 +92,7 @@ namespace exec { ::new (static_cast(self->buf)) T{*reinterpret_cast(other->buf)}; } } + // destroy static auto _destroy(_storage* self) noexcept -> void { if constexpr (!_is_small::value) { @@ -99,6 +101,7 @@ namespace exec { std::destroy_at(reinterpret_cast(self->buf)); } } + // num_nodes static auto _num_nodes(const _storage* self) noexcept -> std::size_t { if constexpr (!_is_small::value) { @@ -107,6 +110,7 @@ namespace exec { return reinterpret_cast(self->buf)->num_nodes(); } } + // num_cpus static auto _num_cpus(const _storage* self, int node) noexcept -> std::size_t { if constexpr (!_is_small::value) { @@ -115,6 +119,7 @@ namespace exec { return reinterpret_cast(self->buf)->num_cpus(node); } } + // bind_to_node static auto _bind_to_node(const _storage* self, int node) noexcept -> int { if constexpr (!_is_small::value) { @@ -123,6 +128,7 @@ namespace exec { return reinterpret_cast(self->buf)->bind_to_node(node); } } + // thread_index_to_node static auto _thread_index_to_node(const _storage* self, std::size_t index) noexcept -> int { if constexpr (!_is_small::value) { diff --git a/include/exec/any_sender_of.hpp b/include/exec/any_sender_of.hpp index 1624a41f0..3f4c847aa 100644 --- a/include/exec/any_sender_of.hpp +++ b/include/exec/any_sender_of.hpp @@ -620,7 +620,7 @@ namespace exec { private: template requires receiver_of<_Rcvr, completion_signatures<_Sigs...>> - && (__callable<__query_vfun_fn<_Rcvr>, _Queries> && ...) + && (__callable<__query_vfun_fn<_Rcvr>, _Queries> && ...) STDEXEC_MEMFN_DECL( auto __create_vtable)(this __mtype<__t>, __mtype<_Rcvr>) noexcept -> const __t* { static const __t __vtable_{ @@ -669,9 +669,9 @@ namespace exec { && (__callable<__query_vfun_fn<_Rcvr>, _Queries> && ...) __ref(_Rcvr& __rcvr) noexcept : __env_{ - __create_vtable(__mtype<__vtable_t>{}, __mtype<_Rcvr>{}), - &__rcvr, - stdexec::get_stop_token(stdexec::get_env(__rcvr))} { + __create_vtable(__mtype<__vtable_t>{}, __mtype<_Rcvr>{}), + &__rcvr, + stdexec::get_stop_token(stdexec::get_env(__rcvr))} { } template @@ -700,8 +700,8 @@ namespace exec { } }; - auto __test_never_stop_token(get_stop_token_t (*)(never_stop_token (*)() noexcept)) - -> __mbool; + auto __test_never_stop_token( + get_stop_token_t (*)(never_stop_token (*)() noexcept)) -> __mbool; template auto __test_never_stop_token(_Tag (*)(_Ret (*)(_As...) noexcept)) -> __mbool; diff --git a/include/exec/async_scope.hpp b/include/exec/async_scope.hpp index 9bdc24f68..28d15e73c 100644 --- a/include/exec/async_scope.hpp +++ b/include/exec/async_scope.hpp @@ -93,7 +93,8 @@ namespace exec { stdexec::start(static_cast<__t*>(__self)->__op_); } - STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS connect_result_t<_Constrained, _Receiver> __op_; + STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS + connect_result_t<_Constrained, _Receiver> __op_; }; }; @@ -214,7 +215,8 @@ namespace exec { struct __t : __nest_op_base<_ReceiverId> { using __id = __nest_op; using __nest_rcvr_t = stdexec::__t<__nest_rcvr<_ReceiverId>>; - STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS connect_result_t<_Constrained, __nest_rcvr_t> __op_; + STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS + connect_result_t<_Constrained, __nest_rcvr_t> __op_; template <__decays_to<_Constrained> _Sender, __decays_to<_Receiver> _Rcvr> explicit __t(const __impl* __scope, _Sender&& __c, _Rcvr&& __rcvr) @@ -356,7 +358,8 @@ namespace exec { _Receiver __rcvr_; std::unique_ptr<__future_state<_Sender, _Env>> __state_; STDEXEC_ATTRIBUTE((no_unique_address)) - stdexec::__optional<__forward_consumer> __forward_consumer_; + stdexec::__optional<__forward_consumer> + __forward_consumer_; public: using __id = __future_op; @@ -381,7 +384,7 @@ namespace exec { _Receiver2&& __rcvr, std::unique_ptr<__future_state<_Sender, _Env>> __state) : __subscription{{}, [](__subscription* __self) noexcept -> void { - static_cast<__t*>(__self)->__complete_(); + static_cast<__t*>(__self)->__complete_(); }} , __rcvr_(static_cast<_Receiver2&&>(__rcvr)) , __state_(std::move(__state)) @@ -733,7 +736,7 @@ namespace exec { : __spawn_op_base<_EnvId>{__env::__join(static_cast<_Env&&>(__env), __spawn_env_{__scope->__stop_source_.get_token()}), [](__spawn_op_base<_EnvId>* __op) { - delete static_cast<__t*>(__op); + delete static_cast<__t*>(__op); }} , __op_(stdexec::connect(static_cast<_Sndr&&>(__sndr), __spawn_receiver_t<_Env>{this})) { } @@ -781,8 +784,8 @@ namespace exec { // start is noexcept so we can assume that the operation will complete // after this, which means we can rely on its self-ownership to ensure // that it is eventually deleted - stdexec::start( - *(new __op_t{nest(static_cast<_Sender&&>(__sndr)), static_cast<_Env&&>(__env), &__impl_})); + stdexec::start(*( + new __op_t{nest(static_cast<_Sender&&>(__sndr)), static_cast<_Env&&>(__env), &__impl_})); } template <__movable_value _Env = empty_env, sender_in<__env_t<_Env>> _Sender> diff --git a/include/exec/at_coroutine_exit.hpp b/include/exec/at_coroutine_exit.hpp index 836895809..7377fae1e 100644 --- a/include/exec/at_coroutine_exit.hpp +++ b/include/exec/at_coroutine_exit.hpp @@ -106,8 +106,8 @@ namespace exec { using __sender = __t<__sender_id<__decay_t<_Sender>>>; template - auto operator()(_Sender&& __sndr) const noexcept(__nothrow_decay_copyable<_Sender>) - -> __sender<_Sender> { + auto operator()(_Sender&& __sndr) const + noexcept(__nothrow_decay_copyable<_Sender>) -> __sender<_Sender> { return __sender<_Sender>{static_cast<_Sender&&>(__sndr)}; } @@ -163,8 +163,8 @@ namespace exec { return false; } - static auto await_suspend(__coro::coroutine_handle<__promise> __h) noexcept - -> __coro::coroutine_handle<> { + static auto await_suspend( + __coro::coroutine_handle<__promise> __h) noexcept -> __coro::coroutine_handle<> { __promise& __p = __h.promise(); auto __coro = __p.__is_unhandled_stopped_ ? __p.continuation().unhandled_stopped() : __p.continuation().handle(); diff --git a/include/exec/create.hpp b/include/exec/create.hpp index b809df8ee..4be162576 100644 --- a/include/exec/create.hpp +++ b/include/exec/create.hpp @@ -94,7 +94,7 @@ namespace exec { struct __create_t { template requires move_constructible<_Fun> - && constructible_from<__decayed_std_tuple<_Args...>, _Args...> + && constructible_from<__decayed_std_tuple<_Args...>, _Args...> auto operator()(_Fun __fun, _Args&&... __args) const -> __t<__sender<_Fun, __id<__decayed_std_tuple<_Args...>>, _Sigs...>> { return {static_cast<_Fun&&>(__fun), {static_cast<_Args&&>(__args)...}}; diff --git a/include/exec/linux/__detail/memory_mapped_region.hpp b/include/exec/linux/__detail/memory_mapped_region.hpp index 12f536f75..ce6b936b9 100644 --- a/include/exec/linux/__detail/memory_mapped_region.hpp +++ b/include/exec/linux/__detail/memory_mapped_region.hpp @@ -42,8 +42,8 @@ namespace exec { , __size_(std::exchange(__other.__size_, 0)) { } - inline auto memory_mapped_region::operator=(memory_mapped_region&& __other) noexcept - -> memory_mapped_region& { + inline auto memory_mapped_region::operator=( + memory_mapped_region&& __other) noexcept -> memory_mapped_region& { if (this != &__other) { if (__ptr_) { ::munmap(__ptr_, __size_); diff --git a/include/exec/linux/__detail/safe_file_descriptor.hpp b/include/exec/linux/__detail/safe_file_descriptor.hpp index c5c63af6a..b3aee1258 100644 --- a/include/exec/linux/__detail/safe_file_descriptor.hpp +++ b/include/exec/linux/__detail/safe_file_descriptor.hpp @@ -30,8 +30,8 @@ namespace exec { : __fd_(std::exchange(__other.__fd_, -1)) { } - inline auto safe_file_descriptor::operator=(safe_file_descriptor&& __other) noexcept - -> safe_file_descriptor& { + inline auto safe_file_descriptor::operator=( + safe_file_descriptor&& __other) noexcept -> safe_file_descriptor& { if (this != &__other) { if (__fd_ != -1) { ::close(__fd_); diff --git a/include/exec/linux/io_uring_context.hpp b/include/exec/linux/io_uring_context.hpp index 0e810863f..c13400e1c 100644 --- a/include/exec/linux/io_uring_context.hpp +++ b/include/exec/linux/io_uring_context.hpp @@ -275,8 +275,8 @@ namespace exec { // This function first completes all tasks that are ready in the completion queue of the io_uring. // Then it completes all tasks that are ready in the given queue of ready tasks. // The function returns the number of previously submitted completed tasks. - auto complete(stdexec::__intrusive_queue<&__task::__next_> __ready = __task_queue{}) noexcept - -> int { + auto complete( + stdexec::__intrusive_queue<&__task::__next_> __ready = __task_queue{}) noexcept -> int { __u32 __head = __head_.load(std::memory_order_relaxed); __u32 __tail = __tail_.load(std::memory_order_acquire); int __count = 0; @@ -419,8 +419,8 @@ namespace exec { return false; } else { __requests_.push_front(__op); - [[maybe_unused]] int __prev = - __n_submissions_in_flight_.fetch_sub(1, std::memory_order_relaxed); + [[maybe_unused]] + int __prev = __n_submissions_in_flight_.fetch_sub(1, std::memory_order_relaxed); STDEXEC_ASSERT(__prev > 0); return true; } @@ -654,8 +654,7 @@ namespace exec { requires(_Op& __op) { { static_cast<_Op&&>(__op).receiver() - } noexcept - -> stdexec::receiver_of>; + } noexcept -> stdexec::receiver_of>; }; template <__stoppable_task _Op> @@ -896,7 +895,8 @@ namespace exec { } void submit(::io_uring_sqe& __sqe) noexcept { - [[maybe_unused]] int prev = __n_ops_.fetch_add(1, std::memory_order_relaxed); + [[maybe_unused]] + int prev = __n_ops_.fetch_add(1, std::memory_order_relaxed); STDEXEC_ASSERT(prev == 0); __context& __context_ = this->__base_.context(); _Receiver& __receiver = this->__base_.receiver(); diff --git a/include/exec/materialize.hpp b/include/exec/materialize.hpp index f3ffedb75..99f961506 100644 --- a/include/exec/materialize.hpp +++ b/include/exec/materialize.hpp @@ -228,8 +228,8 @@ namespace exec { using __sender_t = __t<__sender<__id<_Sender>>>; template - auto operator()(_Sender&& __sndr) const noexcept(__nothrow_decay_copyable<_Sender>) - -> __sender_t<_Sender> { + auto operator()(_Sender&& __sndr) const + noexcept(__nothrow_decay_copyable<_Sender>) -> __sender_t<_Sender> { return __sender_t<_Sender>(static_cast<_Sender&&>(__sndr)); } diff --git a/include/exec/on_coro_disposition.hpp b/include/exec/on_coro_disposition.hpp index 0c7f60093..256b53683 100644 --- a/include/exec/on_coro_disposition.hpp +++ b/include/exec/on_coro_disposition.hpp @@ -108,8 +108,8 @@ namespace exec { return false; } - static auto await_suspend(__coro::coroutine_handle<__promise> __h) noexcept - -> __coro::coroutine_handle<> { + static auto await_suspend( + __coro::coroutine_handle<__promise> __h) noexcept -> __coro::coroutine_handle<> { __promise& __p = __h.promise(); auto __coro = __p.__is_unhandled_stopped_ ? __p.continuation().unhandled_stopped() : __p.continuation().handle(); diff --git a/include/exec/repeat_effect_until.hpp b/include/exec/repeat_effect_until.hpp index b3fad02ff..52d27b135 100644 --- a/include/exec/repeat_effect_until.hpp +++ b/include/exec/repeat_effect_until.hpp @@ -109,8 +109,8 @@ namespace exec { } void __start() noexcept { - const bool __already_started - [[maybe_unused]] = __started_.test_and_set(std::memory_order_relaxed); + const bool __already_started [[maybe_unused]] + = __started_.test_and_set(std::memory_order_relaxed); STDEXEC_ASSERT(!__already_started); stdexec::start(__child_op_.__get()); } @@ -225,7 +225,7 @@ namespace stdexec { struct __sexpr_impl : __sexpr_defaults { static constexpr auto get_completion_signatures = // [](_Sender &&) noexcept // - -> exec::__repeat_effect_until::__completions_t<__data_of<_Sender>> { + -> exec::__repeat_effect_until::__completions_t<__data_of<_Sender>> { return {}; }; }; diff --git a/include/exec/repeat_n.hpp b/include/exec/repeat_n.hpp index 29bdebb95..d9193afe6 100644 --- a/include/exec/repeat_n.hpp +++ b/include/exec/repeat_n.hpp @@ -126,8 +126,8 @@ namespace exec { stdexec::set_value(static_cast<_Receiver &&>(this->__receiver())); } else { - const bool __already_started - [[maybe_unused]] = __started_.test_and_set(std::memory_order_relaxed); + const bool __already_started [[maybe_unused]] + = __started_.test_and_set(std::memory_order_relaxed); STDEXEC_ASSERT(!__already_started); stdexec::start(__child_op_.__get()); } @@ -235,13 +235,12 @@ namespace exec { namespace stdexec { template <> - struct __sexpr_impl - : exec::__repeat_n::__repeat_n_impl { }; + struct __sexpr_impl : exec::__repeat_n::__repeat_n_impl { }; template <> struct __sexpr_impl : __sexpr_defaults { static constexpr auto get_completion_signatures = // - [](_Sender&&) noexcept // + [](_Sender &&) noexcept // -> __completion_signatures_of_t< // transform_sender_result_t> { }; diff --git a/include/exec/sequence/any_sequence_of.hpp b/include/exec/sequence/any_sequence_of.hpp index 50a7bbf38..b92fc6705 100644 --- a/include/exec/sequence/any_sequence_of.hpp +++ b/include/exec/sequence/any_sequence_of.hpp @@ -66,7 +66,7 @@ namespace exec { template requires sequence_receiver_of<_Rcvr, __item_types> - && (__callable<__query_vfun_fn<_Rcvr>, _Queries> && ...) + && (__callable<__query_vfun_fn<_Rcvr>, _Queries> && ...) STDEXEC_MEMFN_DECL( auto __create_vtable)(this __mtype<__t>, __mtype<_Rcvr>) noexcept -> const __t* { static const __t __vtable_{ diff --git a/include/exec/sequence/ignore_all_values.hpp b/include/exec/sequence/ignore_all_values.hpp index 3f8210f1b..de3f80c1d 100644 --- a/include/exec/sequence/ignore_all_values.hpp +++ b/include/exec/sequence/ignore_all_values.hpp @@ -275,7 +275,7 @@ namespace exec { template requires receiver_of<_Receiver, __completion_sigs<_Child>> - && sequence_sender_to<_Child, __receiver_t<_Child>> + && sequence_sender_to<_Child, __receiver_t<_Child>> auto operator()(__ignore, __ignore, _Child&& __child) // noexcept(__nothrow_constructible_from<__operation_t<_Child>, _Child, _Receiver>) -> __operation_t<_Child> { diff --git a/include/exec/sequence/transform_each.hpp b/include/exec/sequence/transform_each.hpp index f0cc2a0dd..84593cd19 100644 --- a/include/exec/sequence/transform_each.hpp +++ b/include/exec/sequence/transform_each.hpp @@ -43,7 +43,7 @@ namespace exec { template _SetNext, same_as<__t> _Self, class _Item> requires __callable<_Adaptor&, _Item> - && __callable> + && __callable> friend auto tag_invoke(_SetNext, _Self& __self, _Item&& __item) // noexcept( __nothrow_callable<_SetNext, _Receiver&, __call_result_t<_Adaptor&, _Item>> // @@ -86,8 +86,8 @@ namespace exec { __t(_Sender&& __sndr, _Receiver __rcvr, _Adaptor __adaptor) : __operation_base< - _Receiver, - _Adaptor>{static_cast<_Receiver&&>(__rcvr), static_cast<_Adaptor&&>(__adaptor)} + _Receiver, + _Adaptor>{static_cast<_Receiver&&>(__rcvr), static_cast<_Adaptor&&>(__adaptor)} , __op_{exec::subscribe( static_cast<_Sender&&>(__sndr), stdexec::__t<__receiver<_ReceiverId, _Adaptor>>{this})} { @@ -190,8 +190,8 @@ namespace exec { 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>> + && 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>> { diff --git a/include/exec/start_now.hpp b/include/exec/start_now.hpp index b72640fcb..1bfa51450 100644 --- a/include/exec/start_now.hpp +++ b/include/exec/start_now.hpp @@ -148,9 +148,8 @@ namespace exec { using connect_t = stdexec::connect_t; template _Receiver> - auto connect(_Receiver __rcvr) const - noexcept(stdexec::__nothrow_move_constructible<_Receiver>) - -> __operation<_EnvId, _Receiver> { + auto connect(_Receiver __rcvr) const noexcept( + stdexec::__nothrow_move_constructible<_Receiver>) -> __operation<_EnvId, _Receiver> { return {__stg_, static_cast<_Receiver&&>(__rcvr)}; } diff --git a/include/exec/static_thread_pool.hpp b/include/exec/static_thread_pool.hpp index 25b2410b7..e575aee9f 100644 --- a/include/exec/static_thread_pool.hpp +++ b/include/exec/static_thread_pool.hpp @@ -872,8 +872,8 @@ namespace exec { return result; } - inline auto static_thread_pool_::thread_state::try_pop() - -> static_thread_pool_::thread_state::pop_result { + inline auto + static_thread_pool_::thread_state::try_pop() -> static_thread_pool_::thread_state::pop_result { pop_result result{nullptr, index_}; result.task = local_queue_.pop_back(); if (result.task) [[likely]] { @@ -882,8 +882,8 @@ namespace exec { return try_remote(); } - inline auto static_thread_pool_::thread_state::try_steal(std::span victims) - -> static_thread_pool_::thread_state::pop_result { + inline auto static_thread_pool_::thread_state::try_steal( + std::span victims) -> static_thread_pool_::thread_state::pop_result { if (victims.empty()) { return {nullptr, index_}; } @@ -1379,8 +1379,8 @@ namespace exec { struct env { static_thread_pool_* pool_; - auto query(get_completion_scheduler_t) noexcept - -> static_thread_pool_::scheduler { + auto query( + get_completion_scheduler_t) noexcept -> static_thread_pool_::scheduler { return pool_->get_scheduler(); } }; @@ -1458,8 +1458,8 @@ namespace exec { __t(Range range, static_thread_pool_& pool, Receiver rcvr) : operation_base_with_receiver< - Range, - Receiver>{std::move(range), pool, static_cast(rcvr)} + Range, + Receiver>{std::move(range), pool, static_cast(rcvr)} , items_(std::ranges::size(this->range_), ItemAllocator(get_allocator(this->rcvr_))) { } diff --git a/include/exec/task.hpp b/include/exec/task.hpp index fe42f41b5..58570d289 100644 --- a/include/exec/task.hpp +++ b/include/exec/task.hpp @@ -184,8 +184,8 @@ namespace exec { // stop_source when stop is requested on the parent coroutine's stop // token. : __stop_callback_{ - get_stop_token(get_env(__parent)), - __forward_stop_request{__stop_source_}} { + get_stop_token(get_env(__parent)), + __forward_stop_request{__stop_source_}} { static_assert( std::is_nothrow_constructible_v<__stop_callback_t, __stop_token_t, __forward_stop_request>); __self.__stop_token_ = __stop_source_.get_token(); @@ -323,8 +323,8 @@ namespace exec { return false; } - static auto await_suspend(__coro::coroutine_handle<__promise> __h) noexcept - -> __coro::coroutine_handle<> { + static auto await_suspend( + __coro::coroutine_handle<__promise> __h) noexcept -> __coro::coroutine_handle<> { return __h.promise().continuation().handle(); } diff --git a/include/exec/timed_thread_scheduler.hpp b/include/exec/timed_thread_scheduler.hpp index 854112ba9..ecc36e891 100644 --- a/include/exec/timed_thread_scheduler.hpp +++ b/include/exec/timed_thread_scheduler.hpp @@ -229,23 +229,23 @@ namespace exec { std::chrono::steady_clock::time_point time_point, Receiver receiver) noexcept : _time_thrd_sched::timed_thread_schedule_operation_base{ - time_point, - [](_time_thrd_sched::timed_thread_operation_base* op) noexcept { - auto* self = static_cast<__t*>(op); - int counter = self->ref_count_.fetch_sub(1, std::memory_order_relaxed); - if (counter == 1) { - self->stop_callback_.reset(); - stdexec::set_stopped(std::move(self->receiver_)); - } - }, - [](_time_thrd_sched::timed_thread_operation_base* op) noexcept { - auto* self = static_cast<__t*>(op); - int counter = self->ref_count_.fetch_sub(1, std::memory_order_relaxed); - if (counter == 1) { - self->stop_callback_.reset(); - stdexec::set_value(std::move(self->receiver_)); - } - }} + time_point, + [](_time_thrd_sched::timed_thread_operation_base* op) noexcept { + auto* self = static_cast<__t*>(op); + int counter = self->ref_count_.fetch_sub(1, std::memory_order_relaxed); + if (counter == 1) { + self->stop_callback_.reset(); + stdexec::set_stopped(std::move(self->receiver_)); + } + }, + [](_time_thrd_sched::timed_thread_operation_base* op) noexcept { + auto* self = static_cast<__t*>(op); + int counter = self->ref_count_.fetch_sub(1, std::memory_order_relaxed); + if (counter == 1) { + self->stop_callback_.reset(); + stdexec::set_value(std::move(self->receiver_)); + } + }} , context_{context} , receiver_{std::move(receiver)} , stop_op_{ diff --git a/include/exec/when_any.hpp b/include/exec/when_any.hpp index aeaf88826..161cf1c44 100644 --- a/include/exec/when_any.hpp +++ b/include/exec/when_any.hpp @@ -43,7 +43,7 @@ namespace exec { template using __nothrow_decay_copyable_and_move_constructible_t = __mbool<( - (__nothrow_decay_copyable<_Ts> && __nothrow_move_constructible<__decay_t<_Ts>>) &&...)>; + (__nothrow_decay_copyable<_Ts> && __nothrow_move_constructible<__decay_t<_Ts>>) && ...)>; template using __as_rvalues = set_value_t (*)(__decay_t...); @@ -269,8 +269,8 @@ namespace exec { } template <__decays_to<__t> _Self, class... _Env> - static auto get_completion_signatures(_Self&&, _Env&&...) noexcept - -> __completions_t<_Self, _Env...> { + static auto + get_completion_signatures(_Self&&, _Env&&...) noexcept -> __completions_t<_Self, _Env...> { return {}; } diff --git a/include/stdexec/__detail/__as_awaitable.hpp b/include/stdexec/__detail/__as_awaitable.hpp index bf9c0c520..fba7e57c9 100644 --- a/include/stdexec/__detail/__as_awaitable.hpp +++ b/include/stdexec/__detail/__as_awaitable.hpp @@ -159,9 +159,9 @@ namespace stdexec { __t(_Sender&& sndr, __coro::coroutine_handle<_Promise> __hcoro) // noexcept(__nothrow_connectable<_Sender, __receiver>) : __op_state_(connect( - static_cast<_Sender&&>(sndr), - __receiver{ - {&this->__result_, __hcoro} + static_cast<_Sender&&>(sndr), + __receiver{ + {&this->__result_, __hcoro} })) { } diff --git a/include/stdexec/__detail/__basic_sender.hpp b/include/stdexec/__detail/__basic_sender.hpp index d80f0cae4..8811ed840 100644 --- a/include/stdexec/__detail/__basic_sender.hpp +++ b/include/stdexec/__detail/__basic_sender.hpp @@ -141,8 +141,8 @@ namespace stdexec { __ignore, __ignore, _ChildOps&... __ops) noexcept { - (_StartTag()(__ops), ...); - }; + (_StartTag()(__ops), ...); + }; inline constexpr auto __complete = // []( @@ -280,8 +280,10 @@ namespace stdexec { using __tag_t = typename __decay_t<_Sexpr>::__tag_t; using __state_t = __state_type_t<__tag_t, _Sexpr, _Receiver>; - STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS _Receiver __rcvr_; - STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS __state_t __state_; + STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS + _Receiver __rcvr_; + STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS + __state_t __state_; __op_base(_Sexpr&& __sndr, _Receiver&& __rcvr) // noexcept( @@ -522,9 +524,9 @@ namespace stdexec { STDEXEC_ATTRIBUTE((host, device, always_inline)) explicit __sexpr(_Tag, _Data&& __data, _Child&&... __child) : __impl_(__detail::__captures( - _Tag(), - static_cast<_Data&&>(__data), - static_cast<_Child&&>(__child)...)) { + _Tag(), + static_cast<_Data&&>(__data), + static_cast<_Child&&>(__child)...)) { } template @@ -533,8 +535,7 @@ namespace stdexec { template STDEXEC_ATTRIBUTE((always_inline)) auto - get_env() const noexcept - -> __result_of<__sexpr_apply, const _Self&, __get_attrs_fn<__tag_t>> { + get_env() const noexcept -> __result_of<__sexpr_apply, const _Self&, __get_attrs_fn<__tag_t>> { return __sexpr_apply(*this, __detail::__drop_front(__impl<_Self>::get_attrs)); } diff --git a/include/stdexec/__detail/__completion_signatures.hpp b/include/stdexec/__detail/__completion_signatures.hpp index 3d7bf6ca9..743dcad41 100644 --- a/include/stdexec/__detail/__completion_signatures.hpp +++ b/include/stdexec/__detail/__completion_signatures.hpp @@ -44,8 +44,7 @@ namespace stdexec { template concept __valid_completion_signatures = // - __same_as<__ok_t<_Completions>, __msuccess> - && __sigs::__is_completion_signatures<_Completions>; + __same_as<__ok_t<_Completions>, __msuccess> && __sigs::__is_completion_signatures<_Completions>; template using __unrecognized_sender_error = // diff --git a/include/stdexec/__detail/__concepts.hpp b/include/stdexec/__detail/__concepts.hpp index 25d0a21df..fa4ef3306 100644 --- a/include/stdexec/__detail/__concepts.hpp +++ b/include/stdexec/__detail/__concepts.hpp @@ -85,7 +85,7 @@ namespace stdexec { concept __all_of = (__same_as<_Ty, _Us> && ...); template - concept __none_of = ((!__same_as<_Ty, _Us>) &&...); + concept __none_of = ((!__same_as<_Ty, _Us>) && ...); template class> constexpr bool __is_instance_of_ = false; @@ -146,7 +146,7 @@ namespace stdexec { #else template inline constexpr bool __destructible_ = // - requires (_Ty && (&__fn) () noexcept) { + requires(_Ty && (&__fn)() noexcept) { { __fn().~_Ty() } noexcept; }; template diff --git a/include/stdexec/__detail/__debug.hpp b/include/stdexec/__detail/__debug.hpp index f3f9bf018..aa2af8704 100644 --- a/include/stdexec/__detail/__debug.hpp +++ b/include/stdexec/__detail/__debug.hpp @@ -34,8 +34,8 @@ namespace stdexec { } template requires tag_invocable<__is_debug_env_t, const _Env&> - auto operator()(const _Env&) const noexcept - -> tag_invoke_result_t<__is_debug_env_t, const _Env&>; + auto + operator()(const _Env&) const noexcept -> tag_invoke_result_t<__is_debug_env_t, const _Env&>; }; template diff --git a/include/stdexec/__detail/__ensure_started.hpp b/include/stdexec/__detail/__ensure_started.hpp index c178cab2a..3254ba197 100644 --- a/include/stdexec/__detail/__ensure_started.hpp +++ b/include/stdexec/__detail/__ensure_started.hpp @@ -42,8 +42,7 @@ namespace stdexec { template requires sender_in<_Sender, _Env> && __decay_copyable> [[nodiscard]] - auto - operator()(_Sender&& __sndr, _Env&& __env = {}) const -> __well_formed_sender auto { + auto operator()(_Sender&& __sndr, _Env&& __env = {}) const -> __well_formed_sender auto { if constexpr (sender_expr_for<_Sender, __ensure_started_t>) { return static_cast<_Sender&&>(__sndr); } else { diff --git a/include/stdexec/__detail/__env.hpp b/include/stdexec/__detail/__env.hpp index 4b06e274c..ee8d08a5a 100644 --- a/include/stdexec/__detail/__env.hpp +++ b/include/stdexec/__detail/__env.hpp @@ -398,7 +398,8 @@ namespace stdexec { // __queryable<_Envs, _Query, _Args...> is true. template STDEXEC_ATTRIBUTE((always_inline)) - constexpr decltype(auto) __get_1st() const noexcept { + constexpr decltype(auto) + __get_1st() const noexcept { constexpr bool __flags[] = {__queryable<_Envs, _Query, _Args...>...}; constexpr std::size_t __idx = __pos_of(__flags, __flags + sizeof...(_Envs)); return __tup::get<__idx>(__tup_); @@ -407,8 +408,9 @@ namespace stdexec { template requires(__queryable<_Envs, _Query, _Args...> || ...) STDEXEC_ATTRIBUTE((always_inline)) - constexpr decltype(auto) query(_Query __q, _Args&&... __args) const noexcept( - __nothrow_queryable()), _Query, _Args...>) { + constexpr decltype(auto) + query(_Query __q, _Args&&... __args) const + noexcept(__nothrow_queryable()), _Query, _Args...>) { return tag_invoke(__q, __get_1st<_Query, _Args...>(), static_cast<_Args&&>(__args)...); } @@ -430,7 +432,8 @@ namespace stdexec { // __queryable<_Envs, _Query, _Args...> is true. template STDEXEC_ATTRIBUTE((always_inline)) - constexpr decltype(auto) __get_1st() const noexcept { + constexpr decltype(auto) + __get_1st() const noexcept { if constexpr (__queryable<_Env0, _Query, _Args...>) { return (__env0_); } else { @@ -441,8 +444,9 @@ namespace stdexec { template requires __queryable<_Env0, _Query, _Args...> || __queryable<_Env1, _Query, _Args...> STDEXEC_ATTRIBUTE((always_inline)) - constexpr decltype(auto) query(_Query __q, _Args&&... __args) const noexcept( - __nothrow_queryable()), _Query, _Args...>) { + constexpr decltype(auto) + query(_Query __q, _Args&&... __args) const + noexcept(__nothrow_queryable()), _Query, _Args...>) { return tag_invoke(__q, __get_1st<_Query, _Args...>(), static_cast<_Args&&>(__args)...); } @@ -573,8 +577,8 @@ namespace stdexec { template requires __callable - auto query(_Tag) const noexcept(__nothrow_callable) - -> __call_result_t { + auto query(_Tag) const + noexcept(__nothrow_callable) -> __call_result_t { return __fun_(_Tag()); } diff --git a/include/stdexec/__detail/__inline_scheduler.hpp b/include/stdexec/__detail/__inline_scheduler.hpp index 12fdc1984..d16fecde5 100644 --- a/include/stdexec/__detail/__inline_scheduler.hpp +++ b/include/stdexec/__detail/__inline_scheduler.hpp @@ -34,8 +34,7 @@ namespace stdexec { template STDEXEC_ATTRIBUTE((host, device)) - STDEXEC_MEMFN_DECL( - auto schedule)(this __scheduler) { + STDEXEC_MEMFN_DECL(auto schedule)(this __scheduler) { return __make_sexpr<_Tag>(); } diff --git a/include/stdexec/__detail/__intrusive_ptr.hpp b/include/stdexec/__detail/__intrusive_ptr.hpp index 0b9dffe6a..658cc7705 100644 --- a/include/stdexec/__detail/__intrusive_ptr.hpp +++ b/include/stdexec/__detail/__intrusive_ptr.hpp @@ -196,8 +196,8 @@ namespace stdexec { } auto operator=(__intrusive_ptr&& __that) noexcept -> __intrusive_ptr& { - [[maybe_unused]] __intrusive_ptr __old{ - std::exchange(__data_, std::exchange(__that.__data_, nullptr))}; + [[maybe_unused]] + __intrusive_ptr __old{std::exchange(__data_, std::exchange(__that.__data_, nullptr))}; return *this; } @@ -205,8 +205,8 @@ namespace stdexec { return operator=(__intrusive_ptr(__that)); } - auto operator=(__enable_intrusive_from_this<_Ty, _ReservedBits>* __that) noexcept - -> __intrusive_ptr& { + auto operator=( + __enable_intrusive_from_this<_Ty, _ReservedBits>* __that) noexcept -> __intrusive_ptr& { return operator=(__that ? __that->__intrusive_from_this() : __intrusive_ptr()); } diff --git a/include/stdexec/__detail/__intrusive_queue.hpp b/include/stdexec/__detail/__intrusive_queue.hpp index d1c2e2ef0..8d0fe734f 100644 --- a/include/stdexec/__detail/__intrusive_queue.hpp +++ b/include/stdexec/__detail/__intrusive_queue.hpp @@ -165,15 +165,13 @@ namespace stdexec { } [[nodiscard]] - auto - operator*() const noexcept -> _Item* { + auto operator*() const noexcept -> _Item* { STDEXEC_ASSERT(__item_ != nullptr); return __item_; } [[nodiscard]] - auto - operator->() const noexcept -> _Item** { + auto operator->() const noexcept -> _Item** { STDEXEC_ASSERT(__item_ != nullptr); return &__item_; } diff --git a/include/stdexec/__detail/__intrusive_slist.hpp b/include/stdexec/__detail/__intrusive_slist.hpp index b03b90bce..5cc8208b3 100644 --- a/include/stdexec/__detail/__intrusive_slist.hpp +++ b/include/stdexec/__detail/__intrusive_slist.hpp @@ -106,15 +106,13 @@ namespace stdexec { } [[nodiscard]] - auto - operator*() const noexcept -> _Item* { + auto operator*() const noexcept -> _Item* { STDEXEC_ASSERT(__item_ != nullptr); return __item_; } [[nodiscard]] - auto - operator->() const noexcept -> _Item** { + auto operator->() const noexcept -> _Item** { STDEXEC_ASSERT(__item_ != nullptr); return &__item_; } diff --git a/include/stdexec/__detail/__let.hpp b/include/stdexec/__detail/__let.hpp index db58c1154..c872028b2 100644 --- a/include/stdexec/__detail/__let.hpp +++ b/include/stdexec/__detail/__let.hpp @@ -381,8 +381,10 @@ namespace stdexec { } } - STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS _Fun __fun_; - STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS _Sched __sched_; + STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS + _Fun __fun_; + STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS + _Sched __sched_; __result_variant __args_{}; __op_state_variant __op_state3_{}; }; diff --git a/include/stdexec/__detail/__manual_lifetime.hpp b/include/stdexec/__detail/__manual_lifetime.hpp index 37a330f05..d2d44aebe 100644 --- a/include/stdexec/__detail/__manual_lifetime.hpp +++ b/include/stdexec/__detail/__manual_lifetime.hpp @@ -41,9 +41,8 @@ namespace stdexec { auto operator=(__manual_lifetime&&) -> __manual_lifetime& = delete; template - auto - __construct(_Args&&... __args) noexcept(stdexec::__nothrow_constructible_from<_Ty, _Args...>) - -> _Ty& { + auto __construct(_Args&&... __args) noexcept( + stdexec::__nothrow_constructible_from<_Ty, _Args...>) -> _Ty& { // Use placement new instead of std::construct_at to support aggregate initialization with // brace elision. return *std::launder(::new (static_cast(__buffer_)) diff --git a/include/stdexec/__detail/__meta.hpp b/include/stdexec/__detail/__meta.hpp index a12298ee2..e62bb86ec 100644 --- a/include/stdexec/__detail/__meta.hpp +++ b/include/stdexec/__detail/__meta.hpp @@ -263,8 +263,7 @@ namespace stdexec { // Use a standard user-defined string literal template template <__mstring _Str> [[deprecated("Use _mstr instead")]] - constexpr auto - operator""__csz() noexcept -> __mtypeof<_Str> { + constexpr auto operator""__csz() noexcept -> __mtypeof<_Str> { return _Str; } @@ -706,8 +705,8 @@ namespace stdexec { struct __mconcat { template using __f = __mapply< - _Continuation, - decltype(__mconcat_<(sizeof...(_Args) == 0)>::__f({}, static_cast<_Args *>(nullptr)...))>; + _Continuation, + decltype(__mconcat_<(sizeof...(_Args) == 0)>::__f({}, static_cast<_Args *>(nullptr)...))>; }; struct __msize { @@ -1172,7 +1171,7 @@ namespace stdexec { struct __mdispatch_<_Ret (*)(_Args...), _Offset> { template requires(__callable<__mdispatch_<_Args, _Offset>, _Ts...> && ...) - && __callable<_Ret, __call_result_t<__mdispatch_<_Args, _Offset>, _Ts...>...> + && __callable<_Ret, __call_result_t<__mdispatch_<_Args, _Offset>, _Ts...>...> auto operator()(_Ts &&...__ts) const noexcept(__nothrow_callable<_Ret, __call_result_t<__mdispatch_<_Args, _Offset>, _Ts...>...>) -> __call_result_t<_Ret, __call_result_t<__mdispatch_<_Args, _Offset>, _Ts...>...> { @@ -1190,8 +1189,8 @@ namespace stdexec { struct __impl { template requires(__callable<__mdispatch_<_Args>, _Ts...> && ...) - && (__callable<__mdispatch_<_Pattern, _Idx + 1>, _Ts...> && ...) - && __callable< // + && (__callable<__mdispatch_<_Pattern, _Idx + 1>, _Ts...> && ...) + && __callable< // _Ret, __call_result_t<__mdispatch_<_Args>, _Ts...>..., __call_result_t<__mdispatch_<_Pattern, _Idx + 1>, _Ts...>...> @@ -1212,7 +1211,7 @@ namespace stdexec { template requires(__offset < sizeof...(_Ts)) - && __callable<__impl, __make_indices, _Ts...> + && __callable<__impl, __make_indices, _Ts...> auto operator()(_Ts &&...__ts) const noexcept(__nothrow_callable<__impl, __make_indices, _Ts...>) -> __msecond< @@ -1223,7 +1222,7 @@ namespace stdexec { template requires(sizeof...(_Ts) == __offset) - && __callable<__mdispatch_<__minvoke<__mpop_back<__qf<_Ret>>, _Args...> *>, _Ts...> + && __callable<__mdispatch_<__minvoke<__mpop_back<__qf<_Ret>>, _Args...> *>, _Ts...> auto operator()(_Ts &&...__ts) const // noexcept( __nothrow_callable<__mdispatch_<__minvoke<__mpop_back<__qf<_Ret>>, _Args...> *>, _Ts...>) diff --git a/include/stdexec/__detail/__on.hpp b/include/stdexec/__detail/__on.hpp index 902232c14..7eebd79b7 100644 --- a/include/stdexec/__detail/__on.hpp +++ b/include/stdexec/__detail/__on.hpp @@ -213,7 +213,7 @@ namespace stdexec { using continue_on_t = v2::on_t; inline constexpr continue_on_t continue_on{}; // for back-compat - } // namespace v2 + } // namespace v2 template <> struct __sexpr_impl : __sexpr_defaults { diff --git a/include/stdexec/__detail/__optional.hpp b/include/stdexec/__detail/__optional.hpp index cd426d140..a49fb3ae8 100644 --- a/include/stdexec/__detail/__optional.hpp +++ b/include/stdexec/__detail/__optional.hpp @@ -34,7 +34,8 @@ namespace stdexec { } }; - inline constexpr struct __nullopt_t {} __nullopt {}; + inline constexpr struct __nullopt_t { + } __nullopt{}; // A simplified version of std::optional for better compile times template diff --git a/include/stdexec/__detail/__read_env.hpp b/include/stdexec/__detail/__read_env.hpp index 63738bba7..b871b0abd 100644 --- a/include/stdexec/__detail/__read_env.hpp +++ b/include/stdexec/__detail/__read_env.hpp @@ -85,9 +85,10 @@ namespace stdexec { __minvoke<__mtry_catch_q<__read::__completions_t, __q<__query_failed_error>>, _Tag, _Env>; static constexpr auto get_completion_signatures = // - [](const _Self&, _Env&&) noexcept -> __completions_t<__data_of<_Self>, _Env> { - return {}; - }; + [](const _Self&, _Env&&) noexcept + -> __completions_t<__data_of<_Self>, _Env> { + return {}; + }; static constexpr auto get_state = // [](const _Self&, _Receiver&) noexcept { diff --git a/include/stdexec/__detail/__receivers.hpp b/include/stdexec/__detail/__receivers.hpp index d176c3951..062859b6a 100644 --- a/include/stdexec/__detail/__receivers.hpp +++ b/include/stdexec/__detail/__receivers.hpp @@ -141,7 +141,7 @@ namespace stdexec { derived_from) || requires { typename _Receiver::is_receiver; } // back-compat, NOT TO SPEC || STDEXEC_IS_BASE_OF(receiver_t, _Receiver); // NOT TO SPEC, for receiver_adaptor - } // namespace __detail + } // namespace __detail template inline constexpr bool enable_receiver = __detail::__enable_receiver<_Receiver>; // NOT TO SPEC diff --git a/include/stdexec/__detail/__run_loop.hpp b/include/stdexec/__detail/__run_loop.hpp index 0ce93821b..32863757f 100644 --- a/include/stdexec/__detail/__run_loop.hpp +++ b/include/stdexec/__detail/__run_loop.hpp @@ -154,8 +154,8 @@ namespace stdexec { return __schedule_task{__loop_}; } - auto query(get_forward_progress_guarantee_t) const noexcept - -> stdexec::forward_progress_guarantee { + auto query( + get_forward_progress_guarantee_t) const noexcept -> stdexec::forward_progress_guarantee { return stdexec::forward_progress_guarantee::parallel; } diff --git a/include/stdexec/__detail/__schedulers.hpp b/include/stdexec/__detail/__schedulers.hpp index eddc7f923..8f429760f 100644 --- a/include/stdexec/__detail/__schedulers.hpp +++ b/include/stdexec/__detail/__schedulers.hpp @@ -69,7 +69,8 @@ namespace stdexec { template concept __sender_has_completion_scheduler = requires(_Scheduler&& __sched) { { - stdexec::__decay_copy(get_completion_scheduler(get_env(schedule(static_cast<_Scheduler&&>(__sched))))) + stdexec::__decay_copy(get_completion_scheduler( + get_env(schedule(static_cast<_Scheduler&&>(__sched))))) } -> same_as<__decay_t<_Scheduler>>; }; diff --git a/include/stdexec/__detail/__senders.hpp b/include/stdexec/__detail/__senders.hpp index 335fac46e..21eab71dd 100644 --- a/include/stdexec/__detail/__senders.hpp +++ b/include/stdexec/__detail/__senders.hpp @@ -337,9 +337,6 @@ namespace stdexec { ///////////////////////////////////////////////////////////////////////////// // early sender type-checking template - concept __well_formed_sender = - __detail::__well_formed_sender< - __minvoke< - __with_default_q<__completion_signatures_of_t, dependent_completions>, - _Sender>>; + concept __well_formed_sender = __detail::__well_formed_sender< + __minvoke<__with_default_q<__completion_signatures_of_t, dependent_completions>, _Sender>>; } // namespace stdexec diff --git a/include/stdexec/__detail/__shared.hpp b/include/stdexec/__detail/__shared.hpp index 011bb4d33..995fb4cc9 100644 --- a/include/stdexec/__detail/__shared.hpp +++ b/include/stdexec/__detail/__shared.hpp @@ -329,7 +329,7 @@ namespace stdexec { } STDEXEC_ASSERT(__waiters_copy.front() != __get_tombstone()); - for (auto __itr = __waiters_copy.begin(); __itr != __waiters_copy.end(); ) { + for (auto __itr = __waiters_copy.begin(); __itr != __waiters_copy.end();) { __local_state_base* __item = *__itr; // We must increment the iterator before calling notify, since notify diff --git a/include/stdexec/__detail/__sync_wait.hpp b/include/stdexec/__detail/__sync_wait.hpp index bcee65183..f5d9725ad 100644 --- a/include/stdexec/__detail/__sync_wait.hpp +++ b/include/stdexec/__detail/__sync_wait.hpp @@ -209,7 +209,7 @@ namespace stdexec { struct sync_wait_t { template _Sender> requires __valid_sync_wait_argument<_Sender> - && __has_implementation_for, _Sender> + && __has_implementation_for, _Sender> auto operator()(_Sender&& __sndr) const -> std::optional<__value_tuple_for_t<_Sender>> { auto __domain = __get_early_domain(__sndr); return stdexec::apply_sender(__domain, *this, static_cast<_Sender&&>(__sndr)); @@ -285,10 +285,10 @@ namespace stdexec { template _Sender> requires __callable< - apply_sender_t, - __early_domain_of_t<_Sender>, - sync_wait_with_variant_t, - _Sender> + apply_sender_t, + __early_domain_of_t<_Sender>, + sync_wait_with_variant_t, + _Sender> auto operator()(_Sender&& __sndr) const -> decltype(auto) { using __result_t = __call_result_t< apply_sender_t, diff --git a/include/stdexec/__detail/__transform_completion_signatures.hpp b/include/stdexec/__detail/__transform_completion_signatures.hpp index 0cab63edd..98ab50d58 100644 --- a/include/stdexec/__detail/__transform_completion_signatures.hpp +++ b/include/stdexec/__detail/__transform_completion_signatures.hpp @@ -100,8 +100,7 @@ namespace stdexec { template using __concat_completion_signatures = // - __mconcat<__qq>::__f< - __mconcat<__qq<__mmake_set>>::__f<_Sigs...>>; + __mconcat<__qq>::__f<__mconcat<__qq<__mmake_set>>::__f<_Sigs...>>; namespace __sigs { ////////////////////////////////////////////////////////////////////////////////////////////////// @@ -119,7 +118,8 @@ namespace stdexec { class... _More, class _What, class... _With> - auto __for_each_completion_signature_fn(_ERROR_<_What, _With...> **) -> _ERROR_<_What, _With...>; + auto + __for_each_completion_signature_fn(_ERROR_<_What, _With...> **) -> _ERROR_<_What, _With...>; template < template @@ -508,26 +508,23 @@ namespace stdexec { sender_in<_Sender, _Env...> && __sends; template - using __single_sender_value_t = - __value_types_t< - __completion_signatures_of_t<_Sender, _Env...>, - __msingle_or, - __q<__msingle>>; + using __single_sender_value_t = __value_types_t< + __completion_signatures_of_t<_Sender, _Env...>, + __msingle_or, + __q<__msingle>>; template - concept __single_value_sender = // - sender_in<_Sender, _Env...> && // + concept __single_value_sender = // + sender_in<_Sender, _Env...> && // requires { typename __single_sender_value_t<_Sender, _Env...>; }; template using __single_value_variant_sender_t = - __value_types_t< - __completion_signatures_of_t<_Sender, _Env...>, - __qq<__types>, __q<__msingle>>; + __value_types_t<__completion_signatures_of_t<_Sender, _Env...>, __qq<__types>, __q<__msingle>>; template concept __single_value_variant_sender = // - sender_in<_Sender, _Env...> && // + sender_in<_Sender, _Env...> && // requires { typename __single_value_variant_sender_t<_Sender, _Env...>; }; // The following utilities are needed fairly often: diff --git a/include/stdexec/__detail/__tuple.hpp b/include/stdexec/__detail/__tuple.hpp index 7c745a46a..ae8a55deb 100644 --- a/include/stdexec/__detail/__tuple.hpp +++ b/include/stdexec/__detail/__tuple.hpp @@ -95,8 +95,10 @@ namespace stdexec { concept __applicable = requires { typename __apply_result_t<_Fn, _Tuple, _Us...>; }; template - concept __nothrow_applicable = __applicable<_Fn, _Tuple, _Us...> && noexcept( - __declval<_Tuple>().apply(__declval<_Fn>(), __declval<_Tuple>(), __declval<_Us>()...)); + concept __nothrow_applicable = + __applicable<_Fn, _Tuple, _Us...> + && noexcept( + __declval<_Tuple>().apply(__declval<_Fn>(), __declval<_Tuple>(), __declval<_Us>()...)); #if STDEXEC_GCC() template @@ -152,8 +154,8 @@ namespace stdexec { template STDEXEC_ATTRIBUTE((host, device, always_inline)) auto - operator()(_Ts &&...__ts) const noexcept(noexcept(__tuple{static_cast<_Ts &&>(__ts)...})) - -> decltype(__tuple{static_cast<_Ts &&>(__ts)...}) { + operator()(_Ts &&...__ts) const noexcept(noexcept(__tuple{ + static_cast<_Ts &&>(__ts)...})) -> decltype(__tuple{static_cast<_Ts &&>(__ts)...}) { return __tuple{static_cast<_Ts &&>(__ts)...}; } } __mktuple{}; diff --git a/include/stdexec/__detail/__type_traits.hpp b/include/stdexec/__detail/__type_traits.hpp index d71659654..30e4e1ff2 100644 --- a/include/stdexec/__detail/__type_traits.hpp +++ b/include/stdexec/__detail/__type_traits.hpp @@ -133,22 +133,22 @@ namespace stdexec { struct __cplr { template - using __f = _Tp&; + using __f = _Tp &; }; struct __cprr { template - using __f = _Tp&&; + using __f = _Tp &&; }; struct __cpclr { template - using __f = const _Tp&; + using __f = const _Tp &; }; struct __cpcrr { template - using __f = const _Tp&&; + using __f = const _Tp &&; }; template @@ -156,13 +156,13 @@ namespace stdexec { template extern __cpc __cpcvr; template - extern __cplr __cpcvr<_Tp&>; + extern __cplr __cpcvr<_Tp &>; template - extern __cprr __cpcvr<_Tp&&>; + extern __cprr __cpcvr<_Tp &&>; template - extern __cpclr __cpcvr; + extern __cpclr __cpcvr; template - extern __cpcrr __cpcvr; + extern __cpcrr __cpcvr; template using __copy_cvref_fn = decltype(__cpcvr<_Tp>); @@ -176,7 +176,7 @@ namespace stdexec { namespace __tt { template - auto __remove_rvalue_reference_fn(_Ty&&) -> _Ty; + auto __remove_rvalue_reference_fn(_Ty &&) -> _Ty; } // namespace __tt template @@ -187,7 +187,7 @@ namespace stdexec { // because of a bizarre nvc++ compiler bug: struct __cref_fn { template - auto operator()(const _Ty&) -> const _Ty&; + auto operator()(const _Ty &) -> const _Ty &; }; template using __cref_t = decltype(__cref_fn{}(__declval<_Ty>())); diff --git a/include/stdexec/__detail/__utility.hpp b/include/stdexec/__detail/__utility.hpp index 0a8ee34b1..69afb644e 100644 --- a/include/stdexec/__detail/__utility.hpp +++ b/include/stdexec/__detail/__utility.hpp @@ -86,7 +86,8 @@ namespace stdexec { return __m; } - inline constexpr std::size_t __pos_of(const bool* const __first, const bool* const __last) noexcept { + inline constexpr std::size_t + __pos_of(const bool* const __first, const bool* const __last) noexcept { for (const bool* __where = __first; __where != __last; ++__where) { if (*__where) { return static_cast(__where - __first); diff --git a/include/stdexec/__detail/__variant.hpp b/include/stdexec/__detail/__variant.hpp index cde341f8e..a5215ed25 100644 --- a/include/stdexec/__detail/__variant.hpp +++ b/include/stdexec/__detail/__variant.hpp @@ -165,9 +165,10 @@ namespace stdexec { noexcept((__nothrow_callable<_Fn, _As..., __copy_cvref_t<_Self, _Ts>> && ...)) { STDEXEC_ASSERT(__self.__index_ != __variant_npos); auto __index = __self.__index_; // make it local so we don't access it after it's deleted. - ((_Is == __index ? static_cast<_Fn &&>(__fn)( - static_cast<_As &&>(__as)..., static_cast<_Self &&>(__self).template get<_Is>()) - : void()), + ((_Is == __index + ? static_cast<_Fn &&>(__fn)( + static_cast<_As &&>(__as)..., static_cast<_Self &&>(__self).template get<_Is>()) + : void()), ...); } diff --git a/include/stdexec/functional.hpp b/include/stdexec/functional.hpp index 4dc1b3631..86fa72f45 100644 --- a/include/stdexec/functional.hpp +++ b/include/stdexec/functional.hpp @@ -236,8 +236,9 @@ namespace stdexec { concept __applicable = __mvalid<__apply_::__result_t, _Fn, _Tup>; template - concept __nothrow_applicable = __applicable<_Fn, _Tup> // - && // + concept __nothrow_applicable = + __applicable<_Fn, _Tup> // + && // noexcept( __apply_::__impl(__apply_::__tuple_indices<_Tup>(), __declval<_Fn>(), __declval<_Tup>())); @@ -250,8 +251,8 @@ namespace stdexec { requires __applicable<_Fn, _Tup> STDEXEC_ATTRIBUTE((always_inline)) constexpr auto - operator()(_Fn&& __fn, _Tup&& __tup) const noexcept(__nothrow_applicable<_Fn, _Tup>) - -> __apply_result_t<_Fn, _Tup> { + operator()(_Fn&& __fn, _Tup&& __tup) const + noexcept(__nothrow_applicable<_Fn, _Tup>) -> __apply_result_t<_Fn, _Tup> { return __apply_::__impl( __apply_::__tuple_indices<_Tup>(), static_cast<_Fn&&>(__fn), static_cast<_Tup&&>(__tup)); } diff --git a/include/stdexec/stop_token.hpp b/include/stdexec/stop_token.hpp index 26e9e5a01..4f622bd6f 100644 --- a/include/stdexec/stop_token.hpp +++ b/include/stdexec/stop_token.hpp @@ -207,8 +207,8 @@ namespace stdexec { _Fun2&& __fun) // noexcept(__nothrow_constructible_from<_Fun, _Fun2>) : __stok::__inplace_stop_callback_base( - __token.__source_, - &inplace_stop_callback::__execute_impl_) + __token.__source_, + &inplace_stop_callback::__execute_impl_) , __fun_(static_cast<_Fun2&&>(__fun)) { __register_callback_(); } @@ -299,9 +299,8 @@ namespace stdexec { (void) __state_.store(__old_state, std::memory_order_release); } - inline auto - inplace_stop_source::__try_lock_unless_stop_requested_(bool __set_stop_requested) const noexcept - -> bool { + inline auto inplace_stop_source::__try_lock_unless_stop_requested_( + bool __set_stop_requested) const noexcept -> bool { __stok::__spin_wait __spin; auto __old_state = __state_.load(std::memory_order_relaxed); do {