std::stop_s...:stop_source(3)
π NAME π
std::stop_source::stop_source β okay bestie, this is the constructor crew for std::stop_source, and the name is literally std::stop_source::stop_source again (it's giving βmy own name is my brandβ π
). We're in the C++ Standard Libary manual β yes, spelled exactly like that in the header, I don't make the rules π β on page std::stop_s...:stop_source(3), so that manual name + page title is folded in near the top like a little ribbon β¨.
β¨ Synopsis β¨
okay so this is the constructor set, and every single one is since C++20 π. They all construct a new std::stop_source object. The signatures, copied exactly and looking all official:
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)
Now the numbered tea β:
- Constructs a
stop_sourcewith new stop-state. Fresh stop-state, new main character energy π. - Constructs an empty
stop_sourcewith no associated stop-state. Literally empty, no stop-state attached, okay? π«Ά - Copy constructor. Constructs a
stop_sourcewhose associated stop-state is the same as that ofother. Shared stop-state, matching vibes π. - Move constructor. Constructs a
stop_sourcewhose associated stop-state is the same as that ofother;otheris left empty. Sootherhands over its stop-state and then is left empty β iconic handoff π«.
π Parameters π
nssβ anstd::nostopstate_tplaceholder object to construct an emptystop_source. It's the βplease make this emptyβ token, periodt.otherβ anotherstop_sourceobject to construct thisstop_sourceobject with. Basically the source material, bestie π¦.
π¦ Postconditions π¦
After construction, here's the vibe check:
stop_possible()istrueandstop_requested()isfalse.stop_possible()andstop_requested()are bothfalse.*thisandothershare the same associated stop-state and compare equal.*thishasother's previously associated stop-state, andother.stop_possible()isfalse.
π Exceptions π
For constructor (1), if memory could not be allocated for the stop-state, the listed exception is std::bad_alloc. That's the one in the manual, bestie β no extra lore from me, just the facts π.
mwah π that's the whole page. Footer source/version: http://cppreference.com; date: 2024.06.10; page: std::stop_s...:stop_source(3). Bye bestie, go construct responsibly πβ¨
π¦ 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