bsl::swap | Set lhs to refer to the stop state (or lack thereof) that rhs referred to, and vice versa. Implementation note: this function is required by the standard to be a hidden friend ([hidden.friends], [stoptoken.general]). |
bsl::operator== | Return true if the specified lhs and rhs refer to the same stop state, or if neither refers to a stop state; false otherwise. Implementation note: this function is required by the standard to be a hidden friend ([hidden.friends], [stoptoken.general]). |
bsl::stop_callback | This class holds an object or reference of type t_CALLBACK and, when constructed using a stop_token that owns a stop state, schedules the held object or reference to be executed by the thread that requests cancellation on that stop state (if any). However, if cancellation was already requested before the stop_callback was constructed, the constructor invokes the callback immediately. If there is no stop state, or request_stop is never called for the stop state, then the callback is not invoked. stop_callback stores its callback within its own footprint, and thus never requires memory allocation; however, stop_callback<t_CALLBACK> is an allocator-aware class, if t_CALLBACK is an allocator-aware class, and any supplied allocator will then be passed to the constructor of t_CALLBACK. |
bsl::stop_source | This class is a mechanism for making and observing cancellation requests. An object of this class may have (possibly shared) ownership of a stop state, in which case it can be used to make a cancellation request or observe whether a cancellation request has been made on the owned stop state; it is also possible for a stop_source object to not own a stop state. Due to its shared ownership semantics, it is safe to pass a copy of a stop_source object to a callback that might outlive the original stop_source object; however, a callback that should only be able to observe a cancellation request, without being able to request cancellation itself, should instead be passed a stop_token, which can be created by calling stop_source::get_token. |