GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::stop_callback::stop_callback(3) C++ Standard Libary std::stop_callback::stop_callback(3)

std::stop_callback::stop_callback - std::stop_callback::stop_callback


template<class C>
explicit stop_callback( const std::stop_token& st, C&& cb ) (1) (since C++20)
noexcept(/*see below*/);
template<class C>
explicit stop_callback( std::stop_token&& st, C&& cb ) (2) (since C++20)
noexcept(/*see below*/);
stop_callback( const stop_callback& ) = delete; (3) (since C++20)
stop_callback( stop_callback&& ) = delete; (4) (since C++20)


Constructs a new stop_callback object, saving and registering the cb callback
function into the given std::stop_token's associated stop-state, for later
invocation if stop is requested on the associated std::stop_source.


1) Constructs a stop_callback for the given st std::stop_token (copied), with the
given invocable callback function cb.
2) Constructs a stop_callback for the given st std::stop_token (moved), with the
given invocable callback function cb.
3-4) stop_callback is neither CopyConstructible nor MoveConstructible.


Both constructors participate overload resolution only if Callback and C satisfy
constructible_from of std::constructible_from<Callback, C>. If Callback and C
satisfy the concept but fail to satisfy its semantic requirement, the behavior is
undefined.


st - a std::stop_token object to register this stop_callback object with
cb - the type to invoke if stop is requested


1-2)
noexcept specification:
noexcept(std::is_nothrow_constructible_v<Callback, C>)
Any exception thrown by constructor-initializing the given callback into the
stop_callback object.


If st.stop_requested() == true for the passed-in std::stop_token, then the callback
function is invoked in the current thread before the constructor returns.

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.