diff --git a/examples/allocator.cpp b/examples/allocator.cpp index 483521c9..cd4655e7 100644 --- a/examples/allocator.cpp +++ b/examples/allocator.cpp @@ -12,7 +12,7 @@ namespace { template struct inline_resource : std::pmr::memory_resource { const char* name; - explicit inline_resource(const char* name) : name(name) {} + explicit inline_resource(const char* n) : name(n) {} std::byte buffer[Size]{}; // NOLINT(hicpp-avoid-c-arrays) std::byte* next{+this->buffer}; // NOLINT(hicpp-no-array-decay) @@ -39,13 +39,13 @@ struct allocator_aware_fun { template requires std::same_as, std::remove_cvref_t> - explicit allocator_aware_fun(F&& fun) : fun(std::forward(fun)) {} - allocator_aware_fun(const allocator_aware_fun& other, allocator_type allocator = {}) - : fun(other.fun), allocator(allocator) {} + explicit allocator_aware_fun(F&& f) : fun(std::forward(f)) {} + allocator_aware_fun(const allocator_aware_fun& other, allocator_type alloc = {}) + : fun(other.fun), allocator(alloc) {} allocator_aware_fun(allocator_aware_fun&& other) noexcept : fun(std::move(other.fun)), allocator(other.allocator) {} - allocator_aware_fun(allocator_aware_fun&& other, allocator_type allocator) - : fun(std::move(other.fun)), allocator(allocator) {} + allocator_aware_fun(allocator_aware_fun&& other, allocator_type alloc) + : fun(std::move(other.fun)), allocator(alloc) {} template auto operator()(Args&&... args) noexcept { diff --git a/examples/doc-just_error.cpp b/examples/doc-just_error.cpp index 0f3fd8dd..24e75b6c 100644 --- a/examples/doc-just_error.cpp +++ b/examples/doc-just_error.cpp @@ -6,13 +6,19 @@ #include namespace ex = beman::execution26; +namespace { +void use(auto&&...) {} +} // namespace + int main() { bool had_error{false}; auto result = ex::sync_wait(ex::just_error(std::error_code(17, std::system_category())) | ex::upon_error([&](std::error_code ec) { + use(ec); assert(ec.value() == 17); had_error = true; })); + use(result, had_error); assert(result); assert(had_error); } diff --git a/examples/doc-just_stopped.cpp b/examples/doc-just_stopped.cpp index b68578cd..5f48cb2d 100644 --- a/examples/doc-just_stopped.cpp +++ b/examples/doc-just_stopped.cpp @@ -7,10 +7,15 @@ #include //-dk:TODO remove namespace ex = beman::execution26; +namespace { +void use(auto&&...) {} +} // namespace + int main() { bool stopped{false}; auto result = ex::sync_wait(ex::just_stopped() | ex::upon_stopped([&] { stopped = true; })); + use(result, stopped); assert(result); assert(stopped); } diff --git a/examples/sender-demo.cpp b/examples/sender-demo.cpp index ab7d8894..384c71aa 100644 --- a/examples/sender-demo.cpp +++ b/examples/sender-demo.cpp @@ -14,8 +14,8 @@ struct just_op_state { std::pmr::string value; template - just_op_state(R&& r, std::pmr::string&& value) - : rec(std::forward(r)), value(std::move(value), ex::get_allocator(ex::get_env(rec))) {} + just_op_state(R&& r, std::pmr::string&& val) + : rec(std::forward(r)), value(std::move(val), ex::get_allocator(ex::get_env(rec))) {} void start() & noexcept { ex::set_value(std::move(rec), std::move(value)); } }; diff --git a/examples/stopping.cpp b/examples/stopping.cpp index d82151f5..4b43c3a2 100644 --- a/examples/stopping.cpp +++ b/examples/stopping.cpp @@ -22,7 +22,7 @@ namespace { struct env { ex::inplace_stop_token token; - env(ex::inplace_stop_token token) : token(token) {} // NOLINT(hicpp-explicit-conversions) + explicit env(ex::inplace_stop_token t) : token(t) {} // NOLINT(hicpp-explicit-conversions) auto query(const ex::get_stop_token_t&) const noexcept { return this->token; } }; @@ -38,7 +38,7 @@ struct inject_cancel_sender { std::remove_cvref_t inner_receiver; ex::inplace_stop_token token{}; - auto get_env() const noexcept -> env { return {this->token}; } + auto get_env() const noexcept -> env { return env(this->token); } template auto set_value(T&&... t) noexcept -> void { diff --git a/tests/beman/execution26/exec-let.test.cpp b/tests/beman/execution26/exec-let.test.cpp index beb4efc5..5a2ac0f6 100644 --- a/tests/beman/execution26/exec-let.test.cpp +++ b/tests/beman/execution26/exec-let.test.cpp @@ -91,7 +91,7 @@ namespace ex = test_std; struct fun { std::pmr::polymorphic_allocator<> allocator{}; fun() {} - explicit fun(std::pmr::polymorphic_allocator<> allocator) : allocator(allocator) {} + explicit fun(std::pmr::polymorphic_allocator<> alloc) : allocator(alloc) {} auto operator()(std::span s) noexcept { return ex::just(std::pmr::vector(s.begin(), s.end(), this->allocator)); } diff --git a/tests/beman/execution26/exec-snd-expos.test.cpp b/tests/beman/execution26/exec-snd-expos.test.cpp index da4c7ff7..591ba5de 100644 --- a/tests/beman/execution26/exec-snd-expos.test.cpp +++ b/tests/beman/execution26/exec-snd-expos.test.cpp @@ -99,7 +99,7 @@ template struct operation_state : test_detail::immovable { using operation_state_concept = test_std::operation_state_t; int* counter; - explicit operation_state(int* counter) : counter(counter) {} + explicit operation_state(int* cntr) : counter(cntr) {} auto start() & noexcept -> void { ++*counter; } }; @@ -499,39 +499,39 @@ auto test_get_domain_late() -> void { } auto test_default_impls_get_attrs() -> void { - struct env { + struct local_env { int value; }; struct child1 { - auto get_env() const noexcept { return env{1}; } + auto get_env() const noexcept { return local_env{1}; } }; struct child2 { - auto get_env() const noexcept { return env{2}; } + auto get_env() const noexcept { return local_env{2}; } }; static_assert(noexcept(test_detail::default_impls::get_attrs(0, child1{}))); static_assert( - std::same_as, decltype(test_detail::default_impls::get_attrs(0, child1{}))>); + std::same_as, decltype(test_detail::default_impls::get_attrs(0, child1{}))>); // static_assert(std::same_as); } auto test_default_impls_get_env() -> void { - struct env { + struct local_env { int value; }; - struct receiver { - auto get_env() const noexcept { return env{1}; } + struct local_receiver { + auto get_env() const noexcept { return local_env{1}; } }; int arg{}; - static_assert(noexcept(test_detail::default_impls::get_env(0, arg, receiver{}))); - static_assert( - std::same_as, decltype(test_detail::default_impls::get_env(0, arg, receiver{}))>); + static_assert(noexcept(test_detail::default_impls::get_env(0, arg, local_receiver{}))); + static_assert(std::same_as, + decltype(test_detail::default_impls::get_env(0, arg, local_receiver{}))>); } auto test_default_impls_get_state() -> void { - struct tag { + struct local_tag { static auto name() { return "test_default_impls_get_state"; } }; struct data { @@ -539,52 +539,52 @@ auto test_default_impls_get_state() -> void { int v2{}; auto operator==(const data&) const -> bool = default; }; - struct sender0 { - tag t{}; + struct local_sender0 { + local_tag t{}; data d{1, 2}; }; - struct sender1 { - tag t{}; + struct local_sender1 { + local_tag t{}; data d{1, 2}; int i1{}; }; - struct sender2 { - tag t{}; + struct local_sender2 { + local_tag t{}; data d{1, 2}; int i1{}; int i2{}; }; - struct sender3 { - tag t{}; + struct local_sender3 { + local_tag t{}; data d{1, 2}; int i1{}; int i2{}; int i3{}; }; - struct sender4 { - tag t{}; + struct local_sender4 { + local_tag t{}; data d{1, 2}; int i1{}; int i2{}; int i3{}; int i4{}; }; - struct receiver {}; - - sender0 s{}; - const sender0 cs{}; - receiver r{}; - static_assert(noexcept(test_detail::default_impls::get_state(sender0{}, r))); - static_assert(std::same_as); - ASSERT((data{1, 2}) == test_detail::default_impls::get_state(sender0{}, r)); - static_assert(std::same_as); - ASSERT((data{1, 2}) == test_detail::default_impls::get_state(sender1{}, r)); - static_assert(std::same_as); - ASSERT((data{1, 2}) == test_detail::default_impls::get_state(sender2{}, r)); - static_assert(std::same_as); - ASSERT((data{1, 2}) == test_detail::default_impls::get_state(sender3{}, r)); - static_assert(std::same_as); - ASSERT((data{1, 2}) == test_detail::default_impls::get_state(sender4{}, r)); + struct local_receiver {}; + + local_sender0 s{}; + const local_sender0 cs{}; + local_receiver r{}; + static_assert(noexcept(test_detail::default_impls::get_state(local_sender0{}, r))); + static_assert(std::same_as); + ASSERT((data{1, 2}) == test_detail::default_impls::get_state(local_sender0{}, r)); + static_assert(std::same_as); + ASSERT((data{1, 2}) == test_detail::default_impls::get_state(local_sender1{}, r)); + static_assert(std::same_as); + ASSERT((data{1, 2}) == test_detail::default_impls::get_state(local_sender2{}, r)); + static_assert(std::same_as); + ASSERT((data{1, 2}) == test_detail::default_impls::get_state(local_sender3{}, r)); + static_assert(std::same_as); + ASSERT((data{1, 2}) == test_detail::default_impls::get_state(local_sender4{}, r)); static_assert(std::same_as); static_assert(std::same_as); } @@ -616,15 +616,15 @@ auto test_default_impls_start() -> void { template auto test_default_impls_complete(Impls) -> void { struct arg {}; - struct receiver { + struct local_receiver { bool& called; }; struct state {}; bool called{false}; - auto non_tag = [](receiver&&, int) {}; - auto tag = [](receiver&& r, int, arg) { r.called = true; }; - receiver r{called}; + auto non_tag = [](local_receiver&&, int) {}; + auto tag = [](local_receiver&& r, int, arg) { r.called = true; }; + local_receiver r{called}; state s{}; static_assert(not requires { Impls::complete(::std::integral_constant{}, s, r, non_tag, 0, arg{}); }); @@ -645,39 +645,39 @@ auto test_default_impls() -> void { } auto test_impls_for() -> void { - struct tag { + struct local_tag { static auto name() { return "test_impls_for"; } }; - static_assert(std::derived_from, test_detail::default_impls>); + static_assert(std::derived_from, test_detail::default_impls>); } auto test_state_type() -> void { - struct tag { + struct local_tag { static auto name() { return "test_state_type"; } }; struct state {}; struct sender { - tag t; + local_tag t; state s; }; - struct receiver {}; + struct local_receiver {}; - static_assert(std::same_as>); + static_assert(std::same_as>); } auto test_basic_state() -> void { - struct tag { + struct local_tag { static auto name() { return "test_basic_state"; } }; struct data {}; - struct sender { - tag t; + struct local_sender { + local_tag t; data d; }; - struct receiver {}; + struct local_receiver {}; - test_detail::basic_state state(sender{}, receiver{}); + test_detail::basic_state state(local_sender{}, local_receiver{}); } auto test_indices_for() -> void { @@ -704,36 +704,37 @@ auto test_valid_specialization() -> void { auto test_env_type() -> void { using index = std::integral_constant; - struct tag { + struct local_tag { static auto name() { return "test_env_type"; } }; struct data {}; - struct env {}; - struct sender { - tag t; + struct local_env {}; + struct local_sender { + local_tag t; data d; }; struct sender_with_env { - tag t; + local_tag t; data d; - auto get_env() const noexcept -> env { return {}; } + auto get_env() const noexcept -> local_env { return {}; } }; - struct receiver {}; + struct local_receiver {}; struct receiver_with_env { - auto get_env() const noexcept -> env { return {}; } + auto get_env() const noexcept -> local_env { return {}; } }; - static_assert( - std::same_as, test_detail::env_type>); static_assert(std::same_as, - test_detail::env_type>); - static_assert(std::same_as, test_detail::env_type>); + test_detail::env_type>); + static_assert(std::same_as, + test_detail::env_type>); + static_assert( + std::same_as, test_detail::env_type>); } template auto test_basic_receiver() -> void { using index = std::integral_constant; - struct tag { + struct local_tag { static auto name() { return "test_basic_receiver"; } }; struct data {}; @@ -741,11 +742,11 @@ auto test_basic_receiver() -> void { int value{}; auto operator==(const err&) const -> bool = default; }; - struct sender { - tag t{}; + struct local_sender { + local_tag t{}; data d{}; }; - struct receiver { + struct local_receiver { T value{}; err error{}; bool stopped{}; @@ -757,14 +758,15 @@ auto test_basic_receiver() -> void { struct unstoppable_receiver { T value; }; - using basic_receiver = test_detail::basic_receiver; + using basic_receiver = test_detail::basic_receiver; static_assert(test_std::receiver); - static_assert(std::same_as); - static_assert(std::same_as, typename basic_receiver::state_t>); + static_assert(std::same_as); + static_assert( + std::same_as, typename basic_receiver::state_t>); ASSERT(&basic_receiver::complete == &test_detail::default_impls::complete); { - test_detail::basic_state op(sender{}, receiver{}); + test_detail::basic_state op(local_sender{}, local_receiver{}); basic_receiver br{&op}; static_assert(not requires { test_std::set_value(std::move(br)); }); static_assert(not requires { test_std::set_value(std::move(br), 42, 1); }); @@ -775,7 +777,7 @@ auto test_basic_receiver() -> void { ASSERT(op.receiver.value == 42); } { - test_detail::basic_state op(sender{}, receiver{}); + test_detail::basic_state op(local_sender{}, local_receiver{}); basic_receiver br{&op}; static_assert(not requires { test_std::set_error(std::move(br)); }); static_assert(not requires { test_std::set_error(std::move(br), 0); }); @@ -786,7 +788,7 @@ auto test_basic_receiver() -> void { ASSERT(op.receiver.error == err{42}); } { - test_detail::basic_state op(sender{}, receiver{}); + test_detail::basic_state op(local_sender{}, local_receiver{}); basic_receiver br{&op}; static_assert(requires { test_std::set_stopped(std::move(br)); }); static_assert(noexcept(test_std::set_stopped(std::move(br)))); @@ -795,8 +797,8 @@ auto test_basic_receiver() -> void { ASSERT(op.receiver.stopped == true); } { - test_detail::basic_state op(sender{}, unstoppable_receiver{}); - test_detail::basic_receiver br{&op}; + test_detail::basic_state op(local_sender{}, unstoppable_receiver{}); + test_detail::basic_receiver br{&op}; static_assert(not requires { std::move(br).set_stopped(); }); } //-dk:TODO test basic_receiver::get_env @@ -815,7 +817,7 @@ auto test_completion_tag() -> void { auto test_product_type() -> void { struct nm { int value{}; - explicit nm(int value) : value(value) {} + explicit nm(int val) : value(val) {} nm(nm&&) = delete; nm(const nm&) = delete; ~nm() = default; @@ -995,7 +997,7 @@ auto test_basic_operation() -> void { auto test_completion_signatures_for() -> void { struct arg {}; - struct env {}; + struct local_env {}; struct bad_env {}; struct sender { using sender_concept = test_std::sender_t; @@ -1003,11 +1005,11 @@ auto test_completion_signatures_for() -> void { using env_sigs = test_std::completion_signatures; auto get_completion_signatures(const test_std::empty_env&) -> empty_env_sigs { return {}; } - auto get_completion_signatures(const env&) -> env_sigs { return {}; } + auto get_completion_signatures(const local_env&) -> env_sigs { return {}; } }; static_assert(test_std::sender_in); - static_assert(test_std::sender_in); + static_assert(test_std::sender_in); static_assert(not test_std::sender_in); #if 0 @@ -1017,7 +1019,7 @@ auto test_completion_signatures_for() -> void { sender::empty_env_sigs >); static_assert(std::same_as< - test_detail::completion_signatures_for, + test_detail::completion_signatures_for, sender::env_sigs >); #endif @@ -1059,7 +1061,7 @@ struct tuple_element { } // namespace std namespace { auto test_basic_sender() -> void { - struct env {}; + struct local_env {}; { auto&& [a, b, c] = tagged_sender{basic_sender_tag{}, data{}, sender0{}}; @@ -1071,13 +1073,13 @@ auto test_basic_sender() -> void { static_assert(test_std::sender); static_assert(test_std::sender_in); - static_assert(test_std::sender_in); + static_assert(test_std::sender_in); static_assert(test_std::operation_state>); static_assert(test_std::sender); static_assert(std::same_as>); static_assert( std::same_as); + decltype(test_std::transform_sender(test_std::default_domain{}, tagged_sender{}, local_env{}))>); using basic_sender = test_detail::basic_sender; static_assert(test_std::sender); @@ -1093,7 +1095,7 @@ auto test_basic_sender() -> void { static_assert(std::same_as>); static_assert( std::same_as); + decltype(test_std::transform_sender(test_std::default_domain{}, basic_sender{}, local_env{}))>); static_assert(test_std::sender_in); #if 0 //-dk:TODO restore completion_sigatures_for test diff --git a/tests/beman/execution26/exec-split.test.cpp b/tests/beman/execution26/exec-split.test.cpp index 9bbaf37b..b3bd9186 100644 --- a/tests/beman/execution26/exec-split.test.cpp +++ b/tests/beman/execution26/exec-split.test.cpp @@ -144,8 +144,7 @@ using to_set_value_t = type_list; void test_completion_sigs_and_sync_wait_on_split() { auto just = beman::execution26::just(NonCopyable{}); auto split = beman::execution26::split(std::move(just)); - using split_sender = std::decay_t; - struct empty_env {}; + using split_sender = std::decay_t; using expected_value_completions = type_list; using value_completions = beman::execution26::value_types_of_t; static_assert(std::same_as); @@ -173,6 +172,7 @@ void test_completion_from_another_thread() { auto split = beman::execution26::split(scheduler.schedule_after(1ms)); auto return_42 = beman::execution26::then(split, [] { return 42; }); auto result = beman::execution26::sync_wait(return_42); + ASSERT(scheduler == scheduler); // avoid a warning about the required op== being unused ASSERT(result.has_value()); if (result.has_value()) { auto [val] = *result; diff --git a/tests/beman/execution26/exec-sync-wait.test.cpp b/tests/beman/execution26/exec-sync-wait.test.cpp index 38d53b47..5a650b42 100644 --- a/tests/beman/execution26/exec-sync-wait.test.cpp +++ b/tests/beman/execution26/exec-sync-wait.test.cpp @@ -137,21 +137,21 @@ auto test_sync_wait_state() -> void { auto test_sync_wait_receiver() -> void { { - using sender = decltype(test_std::just(arg<0>{}, arg<1>{}, arg<2>{})); - test_detail::sync_wait_state state{}; + using local_sender = decltype(test_std::just(arg<0>{}, arg<1>{}, arg<2>{})); + test_detail::sync_wait_state state{}; ASSERT(not state.result); ASSERT(not state.error); - test_std::set_value(test_detail::sync_wait_receiver{&state}, arg<0>{2}, arg<1>{3}, arg<2>{5}); + test_std::set_value(test_detail::sync_wait_receiver{&state}, arg<0>{2}, arg<1>{3}, arg<2>{5}); ASSERT(state.result); ASSERT(not state.error); ASSERT(*state.result == (std::tuple{arg<0>{2}, arg<1>{3}, arg<2>{5}})); } { - using sender = decltype(test_std::just(arg<0>{}, arg<1>{}, arg<2>{})); - test_detail::sync_wait_state state{}; + using local_sender = decltype(test_std::just(arg<0>{}, arg<1>{}, arg<2>{})); + test_detail::sync_wait_state state{}; ASSERT(not state.result); ASSERT(not state.error); - test_std::set_error(test_detail::sync_wait_receiver{&state}, error{17}); + test_std::set_error(test_detail::sync_wait_receiver{&state}, error{17}); ASSERT(not state.result); ASSERT(state.error); try { @@ -164,11 +164,11 @@ auto test_sync_wait_receiver() -> void { } } { - using sender = decltype(test_std::just(arg<0>{}, arg<1>{}, arg<2>{})); - test_detail::sync_wait_state state{}; + using local_sender = decltype(test_std::just(arg<0>{}, arg<1>{}, arg<2>{})); + test_detail::sync_wait_state state{}; ASSERT(not state.result); ASSERT(not state.error); - test_std::set_error(test_detail::sync_wait_receiver{&state}, std::make_exception_ptr(error{17})); + test_std::set_error(test_detail::sync_wait_receiver{&state}, std::make_exception_ptr(error{17})); ASSERT(not state.result); ASSERT(state.error); try { @@ -181,11 +181,11 @@ auto test_sync_wait_receiver() -> void { } } { - using sender = decltype(test_std::just(arg<0>{}, arg<1>{}, arg<2>{})); - test_detail::sync_wait_state state{}; + using local_sender = decltype(test_std::just(arg<0>{}, arg<1>{}, arg<2>{})); + test_detail::sync_wait_state state{}; ASSERT(not state.result); ASSERT(not state.error); - test_std::set_stopped(test_detail::sync_wait_receiver{&state}); + test_std::set_stopped(test_detail::sync_wait_receiver{&state}); ASSERT(not state.result); ASSERT(not state.error); } diff --git a/tests/beman/execution26/exec-then.test.cpp b/tests/beman/execution26/exec-then.test.cpp index f088e286..6875fecf 100644 --- a/tests/beman/execution26/exec-then.test.cpp +++ b/tests/beman/execution26/exec-then.test.cpp @@ -187,11 +187,11 @@ struct allocator_fun { std::pmr::polymorphic_allocator<> alloc; std::byte* data{nullptr}; - explicit allocator_fun(std::pmr::polymorphic_allocator<> alloc) : alloc(alloc), data(alloc.allocate(1)) {} + explicit allocator_fun(std::pmr::polymorphic_allocator<> all) : alloc(all), data(alloc.allocate(1)) {} allocator_fun(const allocator_fun&, std::pmr::polymorphic_allocator<> = {}) {} allocator_fun(allocator_fun&& other) noexcept : alloc(other.alloc), data(std::exchange(other.data, nullptr)) {} - allocator_fun(allocator_fun&& other, std::pmr::polymorphic_allocator<> alloc) - : alloc(alloc), data(alloc == other.alloc ? std::exchange(other.data, nullptr) : alloc.allocate(1)) {} + allocator_fun(allocator_fun&& other, std::pmr::polymorphic_allocator<> all) + : alloc(all), data(alloc == other.alloc ? std::exchange(other.data, nullptr) : alloc.allocate(1)) {} ~allocator_fun() { if (this->data) this->alloc.deallocate(this->data, 1u); diff --git a/tests/beman/execution26/exec-when-all.test.cpp b/tests/beman/execution26/exec-when-all.test.cpp index 0bc0d872..d5709fb8 100644 --- a/tests/beman/execution26/exec-when-all.test.cpp +++ b/tests/beman/execution26/exec-when-all.test.cpp @@ -58,7 +58,7 @@ struct await_cancel { using operation_state_concept = test_std::operation_state_t; struct callback { Receiver* receiver; - explicit callback(Receiver* receiver) : receiver(receiver) {} + explicit callback(Receiver* rcvr) : receiver(rcvr) {} auto operator()() const noexcept -> void { test_std::set_stopped(std::move(*this->receiver)); } }; @@ -116,9 +116,9 @@ struct test_sender { std::remove_cvref_t receiver; decltype(test_std::connect(std::declval(), std::declval>())) inner_state; template - state(S&& sender, auto&& expect, R&& receiver) - : expect(expect), - receiver(std::forward(receiver)), + state(S&& sender, auto&& exp, R&& rcvr) + : expect(exp), + receiver(std::forward(rcvr)), inner_state(test_std::connect(std::forward(sender), upstream{this->expect, this->receiver})) {} auto start() & noexcept -> void { test_std::start(this->inner_state); } diff --git a/tests/beman/execution26/include/test/stop_token.hpp b/tests/beman/execution26/include/test/stop_token.hpp index 189496a1..6a126e7f 100644 --- a/tests/beman/execution26/include/test/stop_token.hpp +++ b/tests/beman/execution26/include/test/stop_token.hpp @@ -84,7 +84,7 @@ inline auto test::stop_callback(const Token& token, Stop stop) -> void { struct Callback { Data* data; - explicit Callback(Data* data) : data(data) {} + explicit Callback(Data* d) : data(d) {} auto operator()() { ++this->data->count; this->data->stop_requested = this->data->token.stop_requested(); @@ -124,7 +124,7 @@ auto test::stop_callback_dtor_deregisters(const Token& token, Stop stop) -> void struct Callback { bool* ptr; - explicit Callback(bool* ptr) : ptr(ptr) {} + explicit Callback(bool* p) : ptr(p) {} auto operator()() { *this->ptr = true; } }; @@ -166,7 +166,7 @@ inline auto test::stop_callback_dtor_other_thread(const Token& token, Stop stop) }; struct Callback { Data* data; - explicit Callback(Data* data) : data(data) {} + explicit Callback(Data* d) : data(d) {} auto operator()() -> void { using namespace ::std::chrono_literals; { @@ -221,7 +221,7 @@ inline auto test::stop_callback_dtor_same_thread(Token token, Stop stop) -> void }; struct Callback { ::std::unique_ptr* self; - explicit Callback(::std::unique_ptr* self) : self(self) {} + explicit Callback(::std::unique_ptr* s) : self(s) {} auto operator()() { this->self->reset(); } }; struct Object : Base {