std::stop_token::operator=(3)
π NAME π
std::stop_token::operator= β the assignment operator for std::stop_token, and this is the std::stop_token::operator=(3) page from the C++ Standard Libary manual. yes, that spelling is the page's, not mine π.
β¨ Synopsis β¨
std::stop_token& operator=( const std::stop_token& other ) noexcept;
(1) (since C++20)
std::stop_token& operator=( std::stop_token&& other ) noexcept;
(2) (since C++20)
okay so this operator replaces the associated stop-state with that of other. both overloads are noexcept, and both have been around since C++20. no cap. π«Ά
- Copy assignment (1) β copy-assigns the associated stop-state of
otherto that of*this. Equivalent tostop_token(other).swap(*this). it's giving "share the stop-state" energy, and it'snoexcept. π - Move assignment (2) β move-assigns the associated stop-state of
otherto that of*this. After the assignment,*thiscontains the previous associated stop-state ofother, andotherhas no associated stop-state. Equivalent tostop_token(std::move(other)).swap(*this). alsonoexcept, also iconic. π₯
πΈ Parameters πΈ
otherβ anotherstd::stop_tokenobject to share the stop-state with, or to acquire the stop-state from. π
mwah π source: cppreference.com Β· version/date: 2024.06.10 Β· page: std::stop_token::operator=(3). stay hydrated and go be a main character with your stop tokens, bestie π«Άπ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms