[stopsource.cons] (original) (raw)
32 Thread support library [thread]
32.3 Stop tokens [thread.stoptoken]
32.3.4 Class stop_source [stopsource]
32.3.4.2 Constructors, copy, and assignment [stopsource.cons]
Effects: Initialises *this to have ownership of a new stop state.
Postconditions: stop_possible() is trueand stop_requested() is false.
Throws: bad_alloc if memory could not be allocated for the stop state.
explicit stop_source(nostopstate_t) noexcept;
Postconditions: stop_possible() is false andstop_requested() is false.
[Note 1:
No resources are allocated for the state.
— _end note_]
stop_source(const stop_source& 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_source(stop_source&& rhs) noexcept;
Postconditions: *this contains the value of rhsprior to the start of construction and rhs.stop_possible() is false.
Effects: Releases ownership of the stop state, if any.
stop_source& operator=(const stop_source& rhs) noexcept;
Effects: Equivalent to: stop_source(rhs).swap(*this).
stop_source& operator=(stop_source&& rhs) noexcept;
Effects: Equivalent to: stop_source(std::move(rhs)).swap(*this).
void swap(stop_source& rhs) noexcept;
Effects: Exchanges the values of *this and rhs.