std::stop_source::stop_source - cppreference.com (original) (raw)
| stop_source(); | (1) | (since C++20) |
|---|---|---|
| explicit stop_source( std::nostopstate_t nss ) noexcept; | (2) | (since C++20) |
| stop_source( const stop_source& other ) noexcept; | (3) | (since C++20) |
| stop_source( stop_source&& other ) noexcept; | (4) | (since C++20) |
Constructs a new stop_source object.
Constructs a
stop_sourcewith new stop-state.Constructs an empty
stop_sourcewith no associated stop-state.Copy constructor. Constructs a
stop_sourcewhose associated stop-state is the same as that of other.Move constructor. Constructs a
stop_sourcewhose associated stop-state is the same as that of other; other is left empty.
[edit] Parameters
| nss | - | an std::nostopstate_t placeholder object to construct an empty stop_source |
|---|---|---|
| other | - | another stop_source object to construct this stop_source object with |
[edit] Postconditions
stop_possible() is true and stop_requested() is false.
stop_possible() and stop_requested() are both false.
*this and other share the same associated stop-state and compare equal.
*this has other's previously associated stop-state, and other.stop_possible() is false.
[edit] Exceptions
- std::bad_alloc if memory could not be allocated for the stop-state.