Skip to content

Commit 170901f

Browse files
committed
clang-format
1 parent 65e70e3 commit 170901f

File tree

4 files changed

+74
-75
lines changed

4 files changed

+74
-75
lines changed

include/beman/execution/detail/async_scope_token.hpp

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,29 @@
1313
// ----------------------------------------------------------------------------
1414

1515
namespace beman::execution::detail {
16-
struct token_test_env {};
17-
18-
struct token_test_sender {
19-
using sender_concept = ::beman::execution::sender_t;
20-
auto get_completion_signatures(::beman::execution::detail::token_test_env) const noexcept {
21-
return ::beman::execution::completion_signatures<>{};
22-
}
23-
};
24-
static_assert(::beman::execution::sender<::beman::execution::detail::token_test_sender>);
25-
static_assert(::beman::execution::sender_in<::beman::execution::detail::token_test_sender, ::beman::execution::detail::token_test_env>);
26-
}
16+
struct token_test_env {};
17+
18+
struct token_test_sender {
19+
using sender_concept = ::beman::execution::sender_t;
20+
auto get_completion_signatures(::beman::execution::detail::token_test_env) const noexcept {
21+
return ::beman::execution::completion_signatures<>{};
22+
}
23+
};
24+
static_assert(::beman::execution::sender<::beman::execution::detail::token_test_sender>);
25+
static_assert(::beman::execution::sender_in<::beman::execution::detail::token_test_sender,
26+
::beman::execution::detail::token_test_env>);
27+
} // namespace beman::execution::detail
2728

2829
namespace beman::execution {
29-
template <typename Token>
30-
concept async_scope_token
31-
= ::std::copyable<Token>
32-
&& requires(Token token) {
33-
{ token.try_associate() } -> ::std::same_as<bool>;
34-
{ token.disassociate() } noexcept;
35-
{ token.wrap(::std::declval<::beman::execution::detail::token_test_sender>()) }
36-
-> ::beman::execution::sender_in<::beman::execution::detail::token_test_env>;
37-
}
38-
;
39-
}
30+
template <typename Token>
31+
concept async_scope_token = ::std::copyable<Token> && requires(Token token) {
32+
{ token.try_associate() } -> ::std::same_as<bool>;
33+
{ token.disassociate() } noexcept;
34+
{
35+
token.wrap(::std::declval<::beman::execution::detail::token_test_sender>())
36+
} -> ::beman::execution::sender_in<::beman::execution::detail::token_test_env>;
37+
};
38+
} // namespace beman::execution
4039

4140
// ----------------------------------------------------------------------------
4241

include/beman/execution/detail/nest.hpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
// ----------------------------------------------------------------------------
1111

1212
namespace beman::execution {
13-
struct nest_t {
14-
template <::beman::execution::sender Sender, ::beman::execution::async_scope_token Token>
15-
auto operator()(Sender&&, Token&&) const {
16-
}
17-
};
18-
inline constexpr nest_t nest{};
19-
}
13+
struct nest_t {
14+
template <::beman::execution::sender Sender, ::beman::execution::async_scope_token Token>
15+
auto operator()(Sender&&, Token&&) const {}
16+
};
17+
inline constexpr nest_t nest{};
18+
} // namespace beman::execution
2019

2120
// ----------------------------------------------------------------------------
2221

tests/beman/execution/exec-nest.test.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
// ----------------------------------------------------------------------------
99

1010
namespace {
11-
struct sender {
12-
using sender_concept = test_std::sender_t;
13-
};
14-
static_assert(test_std::sender<sender>);
15-
static_assert(test_std::sender<sender&>);
16-
static_assert(test_std::sender<sender const&>);
17-
}
11+
struct sender {
12+
using sender_concept = test_std::sender_t;
13+
};
14+
static_assert(test_std::sender<sender>);
15+
static_assert(test_std::sender<sender&>);
16+
static_assert(test_std::sender<const sender&>);
17+
} // namespace
1818

1919
TEST(exec_nest) {
20-
static_assert(std::same_as<test_std::nest_t const, decltype(test_std::nest)>);
20+
static_assert(std::same_as<const test_std::nest_t, decltype(test_std::nest)>);
2121

2222
sender sndr{};
23-
int token{};
24-
//test_std::nest(sndr, token);
23+
int token{};
24+
// test_std::nest(sndr, token);
2525
}

tests/beman/execution/exec-scope-concepts.test.cpp

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,47 +13,48 @@
1313
// ----------------------------------------------------------------------------
1414

1515
namespace {
16-
struct sender {
17-
using sender_concept = test_std::sender_t;
18-
};
19-
static_assert(test_std::sender<sender>);
16+
struct sender {
17+
using sender_concept = test_std::sender_t;
18+
};
19+
static_assert(test_std::sender<sender>);
2020

21-
struct copyable {};
22-
static_assert(std::copyable<copyable>);
23-
struct non_copyable {
24-
non_copyable() = default;
25-
non_copyable(non_copyable const&) = delete;
26-
};
27-
static_assert(not std::copyable<non_copyable>);
21+
struct copyable {};
22+
static_assert(std::copyable<copyable>);
23+
struct non_copyable {
24+
non_copyable() = default;
25+
non_copyable(const non_copyable&) = delete;
26+
};
27+
static_assert(not std::copyable<non_copyable>);
2828

29-
struct empty {};
29+
struct empty {};
3030

31-
template <test_std::sender S>
32-
struct wrap {
33-
using sender_concept = test_std::sender_t;
34-
std::remove_cvref_t<S> sndr;
35-
template <typename E>
36-
auto get_completion_signatures(E const& e) const noexcept {
37-
return test_std::get_completion_signatures(sndr, e);
38-
}
39-
};
40-
static_assert(test_std::sender<wrap<sender>>);
31+
template <test_std::sender S>
32+
struct wrap {
33+
using sender_concept = test_std::sender_t;
34+
std::remove_cvref_t<S> sndr;
35+
template <typename E>
36+
auto get_completion_signatures(const E& e) const noexcept {
37+
return test_std::get_completion_signatures(sndr, e);
38+
}
39+
};
40+
static_assert(test_std::sender<wrap<sender>>);
4141

42-
template <test_std::sender>
43-
struct bad {
44-
using sender_concept = test_std::sender_t;
45-
};
42+
template <test_std::sender>
43+
struct bad {
44+
using sender_concept = test_std::sender_t;
45+
};
4646

47-
48-
template <typename Mem, typename Bool, bool Noexcept, template <test_std::sender> class Wrap>
49-
struct token {
50-
Mem mem{};
51-
auto try_associate() -> Bool { return {}; }
52-
auto disassociate() noexcept(Noexcept) -> void {}
53-
template <test_std::sender Sender>
54-
auto wrap(Sender&& sndr) -> Wrap<Sender> { return Wrap<Sender>(std::forward<Sender>(sndr)); }
55-
};
56-
}
47+
template <typename Mem, typename Bool, bool Noexcept, template <test_std::sender> class Wrap>
48+
struct token {
49+
Mem mem{};
50+
auto try_associate() -> Bool { return {}; }
51+
auto disassociate() noexcept(Noexcept) -> void {}
52+
template <test_std::sender Sender>
53+
auto wrap(Sender&& sndr) -> Wrap<Sender> {
54+
return Wrap<Sender>(std::forward<Sender>(sndr));
55+
}
56+
};
57+
} // namespace
5758

5859
TEST(exec_scope_concepts) {
5960
static_assert(test_std::async_scope_token<token<copyable, bool, true, wrap>>);

0 commit comments

Comments
 (0)