STD::STOP_CALLBACK(3cxx)

πŸ’– NAME πŸ’–

Bestie, this is the std::stop_callback< _Callback > page from the (3cxx) manual. ✨ It's literally a wrapper for callbacks to be run when a stop request is made. That's the whole assignment: callback wrapper, stop request, iconic. πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

First things first, include this:

#include <stop_token>

πŸŽ€ Public Types πŸŽ€

  • using callback_type = _Callback β€” the public type name is exactly callback_type, and it's aliasing _Callback. Slay.

πŸ’… Public Member Functions πŸ’…

Here's the full roster, no skips, no cap:

stop_callback (const stop_callback &)=delete
template<typename _Cb , enable_if_t< is_constructible_v< _Callback, _Cb >, int >  = 0> stop_callback (const stop_token &__token, _Cb &&__cb) noexcept(is_nothrow_constructible_v< _Callback, _Cb >)
stop_callback (stop_callback &&)=delete
template<typename _Cb , enable_if_t< is_constructible_v< _Callback, _Cb >, int >  = 0> stop_callback (stop_token &&__token, _Cb &&__cb) noexcept(is_nothrow_constructible_v< _Callback, _Cb >)
stop_callback & operator= (const stop_callback &)=delete
stop_callback & operator= (stop_callback &&)=delete

The copy constructor and move constructor are both =delete, and the copy assignment and move assignment are also =delete. So yeah, this wrapper is not here for copying or moving, periodt. The constructor templates are constrained by enable_if_t< is_constructible_v< _Callback, _Cb >, int > = 0> and carry noexcept(is_nothrow_constructible_v< _Callback, _Cb >), exactly as shown. πŸ”₯

🌸 Detailed Description 🌸

The deep lore is:

template<typename _Callback> class std::stop_callback< _Callback >"A wrapper for callbacks to be run when a stop request is made.

Yes, the quote is attached right there in the source text β€” I'm not fixing it, I'm just reporting it, iykyk 😭. The meaning is still clear: this is the templated std::stop_callback< _Callback > class, and it's a wrapper for callbacks to be run when a stop request is made.

🌟 Author 🌟

Generated automatically by Doxygen for libstdc++ from the source code. No human author to @, just the auto-gen machine doing its thing. πŸ€–πŸ’–

Mwah πŸ’‹ β€” cute sign-off: source/version libstdc, page footer tag std::stop_callback< _Callback >(3cxx), and the date slot isn't spelled out in this footer, so I'm not inventing one, bestie. 🫢

πŸ“¦ where this page comes from