Skip to content

Commit 5f5ff20

Browse files
committed
more clang-tidy fixes
1 parent acbdae5 commit 5f5ff20

File tree

13 files changed

+35
-40
lines changed

13 files changed

+35
-40
lines changed

include/beman/execution26/detail/basic_sender.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ struct basic_sender : ::beman::execution26::detail::product_type<Tag, Data, Chil
3939
data.children);
4040
}
4141

42-
private:
4342
template <typename Receiver>
4443
requires(not::beman::execution26::receiver<Receiver>)
4544
auto connect(Receiver receiver) = BEMAN_EXECUTION26_DELETE("the passed receiver doesn't model receiver");
45+
private:
4646
#if __cpp_explicit_this_parameter < 202110L
4747
template <::beman::execution26::receiver Receiver>
4848
auto connect(Receiver receiver) & noexcept(true /*-dk:TODO*/)

include/beman/execution26/detail/emplace_from.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct emplace_from {
1717
using type = ::beman::execution26::detail::call_result_t<Fun>;
1818
Fun fun;
1919

20-
constexpr operator type() && noexcept(::beman::execution26::detail::nothrow_callable<Fun>) {
20+
explicit constexpr operator type() && noexcept(::beman::execution26::detail::nothrow_callable<Fun>) {
2121
return ::std::move(fun)();
2222
}
2323
};

include/beman/execution26/detail/forward_like.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ template <typename T>
1919
struct forward_like_helper {
2020
template <typename U>
2121
static auto forward(U&& u) -> ::std::remove_reference_t<U>&& {
22-
return ::std::move(u);
22+
return ::std::move(u); // NOLINT(bugprone-move-forwarding-reference)
2323
}
2424
};
2525
template <typename T>
2626
struct forward_like_helper<T&&> {
2727
template <typename U>
2828
static auto forward(U&& u) -> ::std::remove_cvref_t<U>&& {
29-
return ::std::move(u);
29+
return ::std::move(u); // NOLINT(bugprone-move-forwarding-reference)
3030
}
3131
};
3232
template <typename T>
@@ -40,7 +40,7 @@ template <typename T>
4040
struct forward_like_helper<const T&&> {
4141
template <typename U>
4242
static auto forward(U&& u) -> const ::std::remove_cvref_t<U>&& {
43-
return ::std::move(u);
43+
return ::std::move(u); // NOLINT(bugprone-move-forwarding-reference)
4444
}
4545
};
4646
template <typename T>

include/beman/execution26/detail/fwd_env.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class fwd_env {
2020
Env env;
2121

2222
public:
23-
fwd_env(Env&& env) : env(::std::forward<Env>(env)) {}
23+
explicit fwd_env(Env&& env) : env(::std::forward<Env>(env)) {}
2424

2525
template <typename Query, typename... Args>
2626
requires(not::beman::execution26::forwarding_query(::std::remove_cvref_t<Query>()))

include/beman/execution26/detail/inplace_stop_source.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class beman::execution26::inplace_stop_token {
4040
friend class ::beman::execution26::inplace_stop_source;
4141
template <typename CallbackFun>
4242
friend class ::beman::execution26::inplace_stop_callback;
43-
inplace_stop_token(::beman::execution26::inplace_stop_source* source) : source(source) {}
43+
explicit inplace_stop_token(::beman::execution26::inplace_stop_source* source) : source(source) {}
4444

4545
::beman::execution26::inplace_stop_source* source{};
4646
};

include/beman/execution26/detail/notify.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@
55
#define INCLUDED_BEMAN_EXECUTION26_DETAIL_NOTIFY
66

77
#include <beman/execution26/detail/make_sender.hpp>
8+
#include <beman/execution26/detail/immovable.hpp>
89
#include <mutex>
910
#include <utility>
10-
#include <iostream> //-dk:TODO remove
11-
#include <cassert> //-dk:TODO remove
1211

1312
// ----------------------------------------------------------------------------
1413

1514
namespace beman::execution26::detail {
1615
struct notify_t;
17-
class notifier {
16+
class notifier
17+
: ::beman::execution26::detail::immovable {
1818
public:
19-
notifier() = default;
20-
notifier(notifier&&) = delete;
21-
2219
auto complete() -> void {
2320
::std::unique_lock kerberos(this->lock);
2421
this->completed = true;

include/beman/execution26/detail/sched_attrs.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ class sched_attrs {
2323
Scheduler sched;
2424

2525
public:
26-
sched_attrs(const sched_attrs&) = default;
27-
sched_attrs(sched_attrs&&) = default;
2826
template <typename S>
29-
explicit sched_attrs(S&& sched) : sched(::std::forward<S>(sched)) {}
27+
explicit sched_attrs(S sched) : sched(::std::move(sched)) {}
3028

3129
template <typename Tag>
3230
auto query(const ::beman::execution26::get_completion_scheduler_t<Tag>&) const noexcept {

include/beman/execution26/detail/sched_env.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ class sched_env {
1919
Scheduler sched;
2020

2121
public:
22-
sched_env(const sched_env&) = default;
23-
sched_env(sched_env&&) = default;
2422
template <typename S>
25-
explicit sched_env(S&& sch) : sched(::std::forward<S>(sch)) {}
23+
explicit sched_env(S sch) : sched(::std::move(sch)) {}
2624

2725
auto query(const ::beman::execution26::get_scheduler_t&) const noexcept { return this->sched; }
2826
auto query(const ::beman::execution26::get_domain_t& q) const noexcept {

include/beman/execution26/detail/simple_counting_scope.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <beman/execution26/detail/sender.hpp>
88
#include <beman/execution26/detail/notify.hpp>
9+
#include <beman/execution26/detail/immovable.hpp>
910
#include <atomic>
1011
#include <mutex>
1112
#include <utility>
@@ -19,15 +20,12 @@ class simple_counting_scope;
1920

2021
// ----------------------------------------------------------------------------
2122

22-
class beman::execution26::simple_counting_scope {
23+
class beman::execution26::simple_counting_scope
24+
: ::beman::execution26::detail::immovable {
2325
public:
2426
class token;
2527
class assoc;
2628

27-
simple_counting_scope() = default;
28-
simple_counting_scope(simple_counting_scope&&) = delete;
29-
~simple_counting_scope() = default;
30-
3129
auto get_token() noexcept -> token;
3230
auto close() noexcept -> void {
3331
switch (this->state) {
@@ -60,7 +58,7 @@ class beman::execution26::simple_counting_scope {
6058
}
6159

6260
private:
63-
enum class state_t { unused, open, open_and_joining, closed, closed_and_joining, unused_and_closed, joined };
61+
enum class state_t: unsigned char { unused, open, open_and_joining, closed, closed_and_joining, unused_and_closed, joined };
6462
friend class assoc;
6563
auto try_associate() noexcept -> simple_counting_scope* {
6664
::std::lock_guard lock(this->mutex);
@@ -92,6 +90,7 @@ class beman::execution26::simple_counting_scope {
9290

9391
// ----------------------------------------------------------------------------
9492

93+
// NOLINTBEGIN(misc-unconventional-assign-operator)
9594
class beman::execution26::simple_counting_scope::assoc {
9695
public:
9796
assoc() = default;
@@ -102,7 +101,7 @@ class beman::execution26::simple_counting_scope::assoc {
102101
this->scope->disassociate();
103102
}
104103

105-
auto operator=(assoc other) noexcept -> assoc {
104+
auto operator=(assoc other) noexcept -> assoc& {
106105
::std::swap(this->scope, other.scope);
107106
return *this;
108107
}
@@ -115,6 +114,7 @@ class beman::execution26::simple_counting_scope::assoc {
115114
: scope(scope ? scope->try_associate() : nullptr) {}
116115
beman::execution26::simple_counting_scope* scope{};
117116
};
117+
// NOLINTEND(misc-unconventional-assign-operator)
118118

119119
// ----------------------------------------------------------------------------
120120

tests/beman/execution26/exec-get-domain.test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,5 @@ TEST(exec_get_domain) {
5151
test_get_domain<false, bool>(has_get_domain<false, domain>{42});
5252
test_get_domain<true, domain>(overloaded_get_domain{});
5353

54-
ASSERT(42 == test_std::get_domain(has_get_domain<true, domain>{42}).value);
5554
static_assert(42 == test_std::get_domain(has_get_domain<true, domain>{42}).value);
5655
}

0 commit comments

Comments
 (0)