33 Concurrency support library [thread]

33.3 Stop tokens [thread.stoptoken]

33.3.3 Class stop_token [stoptoken]

33.3.3.2 Constructors, copy, and assignment [stoptoken.cons]

stop_token() noexcept;
Postconditions: stop_possible() is false and stop_requested() is false.
[Note 1: 
Because the created stop_token object can never receive a stop request, no resources are allocated for a stop state.
— end note]
stop_token(const stop_token& rhs) noexcept;
Postconditions: *this == rhs is true.
[Note 2: 
*this and rhs share the ownership of the same stop state, if any.
— end note]
stop_token(stop_token&& rhs) noexcept;
Postconditions: *this contains the value of rhs prior to the start of construction and rhs.stop_possible() is false.
~stop_token();
Effects: Releases ownership of the stop state, if any.
stop_token& operator=(const stop_token& rhs) noexcept;
Effects: Equivalent to: stop_token(rhs).swap(*this).
Returns: *this.
stop_token& operator=(stop_token&& rhs) noexcept;
Effects: Equivalent to: stop_token(std​::​move(rhs)).swap(*this).
Returns: *this.
void swap(stop_token& rhs) noexcept;
Effects: Exchanges the values of *this and rhs.