Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorostsa committed May 29, 2024
1 parent fa2958d commit 1948e56
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ void test_for_each_explicit_sender_direct_async(
using scheduler_t = ex::thread_pool_policy_scheduler<Policy>;

auto exec = ex::explicit_scheduler_executor(scheduler_t(l));
auto result =tt::sync_wait(
hpx::ranges::for_each(policy.on(exec), rng, f));
auto result = tt::sync_wait(hpx::ranges::for_each(policy.on(exec), rng, f));
HPX_TEST(hpx::get<0>(*result) == iterator(std::end(c)));

// verify values
Expand Down Expand Up @@ -114,8 +113,8 @@ void test_for_each_explicit_sender(Policy l, ExPolicy&& policy, IteratorTag)
using scheduler_t = ex::thread_pool_policy_scheduler<Policy>;

auto exec = ex::explicit_scheduler_executor(scheduler_t(l));
auto result = tt::sync_wait(ex::just(rng, f) | hpx::ranges::for_each(policy.on(exec))
);
auto result = tt::sync_wait(
ex::just(rng, f) | hpx::ranges::for_each(policy.on(exec)));
HPX_TEST(hpx::get<0>(*result) == iterator(std::end(c)));

// verify values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ void test_for_each_sender(Policy l, ExPolicy&& p, IteratorTag)
using scheduler_t = ex::thread_pool_policy_scheduler<Policy>;

auto exec = ex::explicit_scheduler_executor(scheduler_t(l));
auto result = hpx::get<0>(*tt::sync_wait(ex::just(rng, f) |
hpx::ranges::for_each(p.on(exec)) ));
auto result = hpx::get<0>(
*tt::sync_wait(ex::just(rng, f) | hpx::ranges::for_each(p.on(exec))));
HPX_TEST(result == iterator(std::end(c)));

// verify values
Expand Down
22 changes: 12 additions & 10 deletions libs/core/execution/include/hpx/execution/algorithms/bulk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ namespace hpx::execution::experimental {
hpx::execution::experimental::completion_signatures<>;

template <typename Env>
friend auto tag_invoke(get_completion_signatures_t,
bulk_sender const&, Env) noexcept -> hpx::execution::
experimental::transform_completion_signatures_of<Sender, Env,
hpx::execution::experimental::completion_signatures<
hpx::execution::experimental::set_error_t(
std::exception_ptr)>,
default_set_value, default_set_error, disable_set_stopped>;
friend auto tag_invoke(
get_completion_signatures_t, bulk_sender const&, Env) noexcept
-> hpx::execution::experimental::
transform_completion_signatures_of<Sender, Env,
hpx::execution::experimental::completion_signatures<
hpx::execution::experimental::set_error_t(
std::exception_ptr)>,
default_set_value, default_set_error,
disable_set_stopped>;

friend constexpr auto tag_invoke(
hpx::execution::experimental::get_env_t,
Expand All @@ -93,9 +95,9 @@ namespace hpx::execution::experimental {
};

template <typename Env>
friend auto tag_invoke(
get_completion_signatures_t, bulk_sender const&, Env) noexcept
-> generate_completion_signatures<Env>;
friend auto tag_invoke(get_completion_signatures_t,
bulk_sender const&,
Env) noexcept -> generate_completion_signatures<Env>;

// clang-format off
template <typename CPO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ namespace hpx::execution::experimental {

template <typename Env>
friend auto tag_invoke(get_completion_signatures_t,
let_error_sender const&, Env) noexcept
-> generate_completion_signatures<Env>;
let_error_sender const&,
Env) noexcept -> generate_completion_signatures<Env>;

// clang-format off
template <typename CPO, typename Scheduler_ = Scheduler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ namespace hpx::execution::experimental {

template <typename Env>
friend auto tag_invoke(get_completion_signatures_t,
let_stopped_sender const&, Env) noexcept
-> generate_completion_signatures<Env>;
let_stopped_sender const&,
Env) noexcept -> generate_completion_signatures<Env>;

// clang-format off
template <typename CPO, typename Scheduler_ = Scheduler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ namespace hpx::execution::experimental {

template <typename Env>
friend auto tag_invoke(get_completion_signatures_t,
let_value_sender const&, Env) noexcept
-> generate_completion_signatures<Env>;
let_value_sender const&,
Env) noexcept -> generate_completion_signatures<Env>;

// clang-format off
template <typename CPO, typename Scheduler_ = Scheduler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ namespace hpx::execution::experimental {
template <typename Env>
friend auto tag_invoke(
hpx::execution::experimental::get_completion_signatures_t,
run_loop_sender const&, Env) noexcept
-> completion_signatures;
run_loop_sender const&,
Env) noexcept -> completion_signatures;

run_loop& loop;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ namespace hpx::execution::experimental {
};

template <typename Env>
friend auto tag_invoke(
get_completion_signatures_t, schedule_from_sender const&, Env)
-> generate_completion_signatures<Env>;
friend auto tag_invoke(get_completion_signatures_t,
schedule_from_sender const&,
Env) -> generate_completion_signatures<Env>;

// clang-format off
template <typename CPO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ namespace hpx::execution::experimental {
};

template <typename Env>
friend auto tag_invoke(
get_completion_signatures_t, split_sender const&, Env)
-> generate_completion_signatures<Env>;
friend auto tag_invoke(get_completion_signatures_t,
split_sender const&,
Env) -> generate_completion_signatures<Env>;

// clang-format off
template <typename CPO, typename Scheduler_ = Scheduler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ namespace hpx::execution::experimental {

template <typename Env>
friend auto tag_invoke(get_completion_signatures_t,
when_all_sender const&, Env) noexcept
-> generate_completion_signatures<Env>;
when_all_sender const&,
Env) noexcept -> generate_completion_signatures<Env>;

static constexpr std::size_t num_predecessors = sizeof...(Senders);
static_assert(num_predecessors > 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ namespace hpx::when_all_vector_detail {
template <typename Env>
friend auto tag_invoke(
hpx::execution::experimental::get_completion_signatures_t,
when_all_vector_sender_type const&, Env) noexcept
-> generate_completion_signatures<Env>;
when_all_vector_sender_type const&,
Env) noexcept -> generate_completion_signatures<Env>;
#endif

template <typename Receiver>
Expand Down Expand Up @@ -249,7 +249,8 @@ namespace hpx::when_all_vector_detail {
friend auto tag_invoke(hpx::execution::experimental::get_env_t,
when_all_vector_receiver const& r)
#ifdef HPX_HAVE_STDEXEC
noexcept -> hpx::execution::experimental::make_env_t<
noexcept
-> hpx::execution::experimental::make_env_t<
hpx::execution::experimental::env_of_t<receiver_type>,
hpx::execution::experimental::with_t<
hpx::execution::experimental::get_stop_token_t,
Expand Down
6 changes: 3 additions & 3 deletions libs/core/execution/include/hpx/execution/queries/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ namespace hpx::execution::experimental {
}

template <typename Tag1>
friend auto tag_invoke(
get_completion_signatures_t, read_sender<Tag1>, no_env)
-> dependent_completion_signatures<no_env>;
friend auto tag_invoke(get_completion_signatures_t,
read_sender<Tag1>,
no_env) -> dependent_completion_signatures<no_env>;

// clang-format off
template <typename Env>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -789,10 +789,10 @@ namespace hpx::execution::experimental {
set_value_t(Ts...), set_error_t(std::exception_ptr)>;
#else
template <typename Env>
friend auto tag_invoke(
get_completion_signatures_t, unique_any_sender const&, Env) noexcept
-> completion_signatures<set_value_t(Ts...),
set_error_t(std::exception_ptr)>;
friend auto tag_invoke(get_completion_signatures_t,
unique_any_sender const&,
Env) noexcept -> completion_signatures<set_value_t(Ts...),
set_error_t(std::exception_ptr)>;
#endif

template <typename R>
Expand Down Expand Up @@ -875,7 +875,7 @@ namespace hpx::execution::experimental {
template <typename Env>
friend auto tag_invoke(get_completion_signatures_t, any_sender const&,
Env) noexcept -> completion_signatures<set_value_t(Ts...),
set_error_t(std::exception_ptr)>;
set_error_t(std::exception_ptr)>;
#endif

template <typename R>
Expand Down
8 changes: 4 additions & 4 deletions libs/core/execution_base/tests/include/coroutine_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ struct scope_guard
{
Fn fn_;
scope_guard(Fn fn) noexcept
: fn_((Fn &&) fn)
: fn_((Fn&&) fn)
{
}
~scope_guard()
{
((Fn &&) fn_)();
((Fn&&) fn_)();
}
};

Expand Down Expand Up @@ -405,7 +405,7 @@ class basic_task
}

// Make this task generally awaitable:
friend task_awaitable<> operator co_await(basic_task&& self) noexcept
friend task_awaitable<> operator co_await(basic_task && self) noexcept
{
static_assert(well_formed<awaiter_context_t, _promise>);
return task_awaitable<>{std::exchange(self.coro_, {})};
Expand All @@ -423,7 +423,7 @@ class basic_task
friend auto tag_invoke(
hpx::execution::experimental::get_completion_signatures_t,
const basic_task&, auto) -> std::conditional_t<std::is_void_v<T>,
task_traits_t<>, task_traits_t<T>>;
task_traits_t<>, task_traits_t<T>>;

explicit basic_task(hpx::coroutine_handle<promise_type> hcoro) noexcept
: coro_(hcoro)
Expand Down
22 changes: 11 additions & 11 deletions libs/core/execution_base/tests/unit/completion_signatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ namespace ex = hpx::execution::experimental;

///////////////////////////////////////////////////////////////////////////////
template <typename... Values>
auto signature_values(Values...)
-> ex::completion_signatures<ex::set_value_t(Values...)>
auto signature_values(
Values...) -> ex::completion_signatures<ex::set_value_t(Values...)>
{
return {};
}
Expand All @@ -35,17 +35,17 @@ auto signature_stopped() -> ex::completion_signatures<ex::set_stopped_t()>
}

template <typename Error, typename... Values>
auto signature_error_values(Error, Values...)
-> ex::completion_signatures<ex::set_value_t(Values...),
ex::set_error_t(Error)>
auto signature_error_values(
Error, Values...) -> ex::completion_signatures<ex::set_value_t(Values...),
ex::set_error_t(Error)>
{
return {};
}

template <typename... Values>
auto signature_values_stopped(Values...)
-> ex::completion_signatures<ex::set_value_t(Values...),
ex::set_stopped_t()>
auto signature_values_stopped(
Values...) -> ex::completion_signatures<ex::set_value_t(Values...),
ex::set_stopped_t()>
{
return {};
}
Expand All @@ -58,9 +58,9 @@ auto signature_error_stopped(Error)
}

template <typename Error, typename... Values>
auto signature_all(Error, Values...)
-> ex::completion_signatures<ex::set_value_t(Values...),
ex::set_error_t(Error), ex::set_stopped_t()>
auto signature_all(
Error, Values...) -> ex::completion_signatures<ex::set_value_t(Values...),
ex::set_error_t(Error), ex::set_stopped_t()>
{
return {};
}
Expand Down
4 changes: 2 additions & 2 deletions libs/core/execution_base/tests/unit/get_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace mylib {
inline constexpr struct receiver_env_t final : ex::forwarding_query_t
{
template <typename Env>
requires ex::tag_invocable<receiver_env_t, Env>
requires ex::tag_invocable<receiver_env_t, Env>
auto operator()(Env const& e) const
{
return ex::tag_invoke(*this, e);
Expand Down Expand Up @@ -106,7 +106,7 @@ namespace mylib {
inline constexpr struct receiver_env1_t final : ex::forwarding_query_t
{
template <typename Env>
requires ex::tag_invocable<receiver_env1_t, Env>
requires ex::tag_invocable<receiver_env1_t, Env>
auto operator()(Env const& e) const
{
return ex::tag_invoke(*this, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,8 @@ namespace hpx::execution::experimental::detail {
template <typename Env>
friend auto tag_invoke(
hpx::execution::experimental::get_completion_signatures_t,
thread_pool_bulk_sender const&, Env)
-> generate_completion_signatures<Env>;
thread_pool_bulk_sender const&,
Env) -> generate_completion_signatures<Env>;

// clang-format off
template <typename CPO,
Expand Down
6 changes: 3 additions & 3 deletions libs/core/type_support/include/hpx/type_support/meta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,11 @@ namespace hpx::meta {

template <typename T, typename... As>
inline constexpr bool is_constructible_from_v =
std::is_destructible_v<T>&& std::is_constructible_v<T, As...>;
std::is_destructible_v<T> && std::is_constructible_v<T, As...>;

template <typename T, typename... As>
inline constexpr bool is_nothrow_constructible_from_v =
is_constructible_from_v<T, As...>&&
std::is_nothrow_constructible_v<T, As...>;
is_constructible_from_v<T, As...> &&
std::is_nothrow_constructible_v<T, As...>;

} // namespace hpx::meta
8 changes: 4 additions & 4 deletions libs/core/type_support/include/hpx/type_support/pack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ namespace hpx::util {
static constexpr std::false_type all_of(...);

template <typename... Ts>
static constexpr auto all_of(int)
-> always_true<std::enable_if_t<is_true<Ts>::value>...>;
static constexpr auto all_of(
int) -> always_true<std::enable_if_t<is_true<Ts>::value>...>;
} // namespace detail

template <typename... Ts>
Expand All @@ -130,8 +130,8 @@ namespace hpx::util {
static constexpr std::true_type any_of(...);

template <typename... Ts>
static constexpr auto any_of(int)
-> always_false<std::enable_if_t<is_false<Ts>::value>...>;
static constexpr auto any_of(
int) -> always_false<std::enable_if_t<is_false<Ts>::value>...>;
} // namespace detail

template <typename... Ts>
Expand Down

0 comments on commit 1948e56

Please sign in to comment.