@@ -49,10 +49,14 @@ struct beman::execution26::detail::stop_callback_base {
4949 virtual auto do_call () -> void = 0;
5050
5151 protected:
52- stop_callback_base (const ::beman::execution26::stop_token&);
52+ explicit stop_callback_base (const ::beman::execution26::stop_token&);
5353 ~stop_callback_base ();
5454
5555 public:
56+ stop_callback_base (stop_callback_base&&) = delete ;
57+ stop_callback_base (const stop_callback_base&) = delete ;
58+ auto operator =(stop_callback_base&&) -> stop_callback_base& = delete ;
59+ auto operator =(const stop_callback_base&) -> stop_callback_base& = delete ;
5660 auto call () -> void;
5761 auto setup () -> void;
5862 auto deregister () -> void;
@@ -75,7 +79,9 @@ class beman::execution26::stop_source {
7579 stop_source ();
7680 explicit stop_source (::beman::execution26::nostopstate_t ) noexcept ;
7781 stop_source (const stop_source&);
82+ stop_source (stop_source&&) = default ;
7883 auto operator =(const stop_source&) -> stop_source&;
84+ auto operator =(stop_source&&) -> stop_source& = default ;
7985 ~stop_source ();
8086
8187 auto swap (stop_source&) noexcept -> void;
@@ -93,7 +99,7 @@ class beman::execution26::stop_token {
9399 friend ::beman::execution26::detail::stop_callback_base;
94100 ::std::shared_ptr<::beman::execution26::detail::stop_state> state;
95101
96- stop_token (::std::shared_ptr<::beman::execution26::detail::stop_state>);
102+ explicit stop_token (::std::shared_ptr<::beman::execution26::detail::stop_state>);
97103
98104 public:
99105 template <typename Fun>
@@ -137,8 +143,11 @@ class beman::execution26::stop_callback final : private CallbackFun, beman::exec
137143 : CallbackFun(::std::forward<Initializer>(init)), stop_callback_base(::std::move(token)) {
138144 this ->setup ();
139145 }
140- ~ stop_callback () { this -> deregister (); }
146+ stop_callback (const stop_callback&) = delete ;
141147 stop_callback (stop_callback&&) = delete ;
148+ ~stop_callback () { this ->deregister (); }
149+ auto operator =(stop_callback&&) -> stop_callback& = delete ;
150+ auto operator =(const stop_callback&) -> stop_callback& = delete ;
142151};
143152
144153// ----------------------------------------------------------------------------
@@ -207,9 +216,7 @@ inline beman::execution26::stop_source::stop_source(const stop_source& other) :
207216}
208217
209218inline auto beman::execution26::stop_source::operator =(const stop_source& other) -> stop_source& {
210- --this ->state ->sources ;
211- this ->state = other.state ;
212- ++this ->state ->sources ;
219+ stop_source (other).swap (*this );
213220 return *this ;
214221}
215222
0 commit comments