Skip to content

Commit

Permalink
run clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres-Salamanca committed Jan 30, 2025
1 parent ed3291e commit 96e0333
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 31 deletions.
11 changes: 4 additions & 7 deletions include/beman/execution/detail/bulk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@
#include <type_traits>
#include <utility>


#include <beman/execution/detail/suppress_push.hpp>
namespace beman::execution::detail {

struct bulk_t {


template <class Sender, class Shape, class f>
requires(::beman::execution::sender<Sender> && std::is_integral_v<Shape> &&
::beman::execution::detail::movable_value<f>)
Expand All @@ -56,8 +54,8 @@ struct impls_for<bulk_t> : ::beman::execution::detail::default_impls {
Index, State& state, Rcvr& rcvr, Tag, Args&&... args) noexcept -> void
requires(not::std::same_as<Tag, set_value_t> ||
requires(State& s, Args&&... a) {
(s.template get<1>())(s.template get<0>(), ::std::forward<Args>(a)...);
})
(s.template get<1>())(s.template get<0>(), ::std::forward<Args>(a)...);
})
{
if constexpr (std::same_as<Tag, set_value_t>) {
auto& [shape, f] = state;
Expand Down Expand Up @@ -98,20 +96,19 @@ struct completion_signatures_for_impl<
using make_error_completions =
::beman::execution::completion_signatures<::beman::execution::set_error_t(const std::decay_t<Args>&)...>;

// Retrieves the value completion signatures from the Sender using Env,
// Retrieves the value completion signatures from the Sender using Env,
// then applies `make_value_completions` to format them and merges all signatures.
using value_completions = ::beman::execution::
value_types_of_t<Sender, Env, make_value_completions, ::beman::execution::detail::meta::combine>;

// Retrieves the error completion signatures from the Sender using Env,
// Retrieves the error completion signatures from the Sender using Env,
// then applies make_error_completions to format them.
using error_completions = ::beman::execution::error_types_of_t<Sender, Env, make_error_completions>;

using fixed_completions =
::beman::execution::completion_signatures<::beman::execution::set_stopped_t(),
::beman::execution::set_error_t(std::exception_ptr)>;


using type = ::beman::execution::detail::meta::unique<
::beman::execution::detail::meta::combine<fixed_completions, value_completions, error_completions>>;
};
Expand Down
39 changes: 15 additions & 24 deletions tests/beman/execution/exec-bulk.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,30 @@
#include <beman/execution/detail/bulk.hpp>
#include <beman/execution/detail/just.hpp>

auto test_bulk() {
auto b0 = test_std::bulk(test_std::just(), 1, [](int) {});

static_assert(test_std::sender<decltype(b0)>);

int counter = 0;

auto test_bulk(){
auto b0 = test_std::bulk(test_std::just(), 1, [](int) {});

static_assert(test_std::sender<decltype(b0)>);

int counter = 0;

auto b1 = test_std::bulk(test_std::just(), 5, [&](int i) {
counter += i;
});

static_assert(test_std::sender<decltype(b1)>);
test_std::sync_wait(b1);
ASSERT(counter == 10);
auto b1 = test_std::bulk(test_std::just(), 5, [&](int i) { counter += i; });

static_assert(test_std::sender<decltype(b1)>);
test_std::sync_wait(b1);
ASSERT(counter == 10);
}

TEST(exec_bulk){
TEST(exec_bulk) {

try {

try {
test_bulk();

test_bulk();
} catch (...) {

} catch (...) {

ASSERT(nullptr == "the bulk tests shouldn't throw");
}

return EXIT_SUCCESS;
ASSERT(nullptr == "the bulk tests shouldn't throw");
}

return EXIT_SUCCESS;
}

0 comments on commit 96e0333

Please sign in to comment.