std::stop_source(3)

πŸ’– std::stop_source β€” from the libstdc++ manual, bestie edition πŸ’–

okay so you found the page for std::stop_source in the Library Functions Manual and I'm literally so proud of you. grab a strawberry πŸ“, this one's a banger.


✨ NAME ✨

std::stop_source β€” a type that lets you make a stop request. that's it, that's the whole job. it's giving "the one who says stop" energy πŸ‘‘


🌸 SYNOPSIS 🌸

first things first, you gotta let it in:

#include <stop_token>

πŸ’… Public Member Functions πŸ’…

  • stop_source(const stop_source &__other) noexcept β€” copy constructor, copies from __other, and it's noexcept because we don't do surprises here 🫢
  • stop_source(std::nostopstate_t) noexcept β€” the special one. hand it std::nostopstate_t and you get a stop_source that has no associated stop-state at all. also noexcept ✨
  • stop_source(stop_source &&) noexcept=default β€” move constructor, noexcept, and it's =default (the compiler handles it, she's lowkey built different) πŸ¦‹
  • stop_token get_token() const noexcept β€” hands you a stop_token so you can actually check in on the vibes. const, noexcept 🌈
  • stop_source & operator=(const stop_source &__other) noexcept β€” copy assignment from __other. noexcept πŸ’–
  • stop_source & operator=(stop_source &&) noexcept=default β€” move assignment, noexcept, =default, iconic ⭐
  • bool request_stop() const noexcept β€” the main character move: make the stop request. returns bool. const and noexcept πŸ‘‘
  • bool stop_possible() const noexcept β€” asks "is a stop even possible?" returns bool. const, noexcept πŸŽ€
  • bool stop_requested() const noexcept β€” asks "has a stop been requested?" returns bool. const, noexcept 🧚
  • void swap(stop_source &__other) noexcept β€” swaps with __other, returns void, noexcept πŸ’œ

🫢 Friends 🫢

these are the ones in the group chat that get special access, no cap:

  • bool operator==(const stop_source &__a, const stop_source &__b) noexcept β€” compares __a and __b, returns bool, noexcept πŸ’–
  • void swap(stop_source &__lhs, stop_source &__rhs) noexcept β€” swaps __lhs and __rhs, returns void, noexcept ✨

πŸ”₯ Detailed Description πŸ”₯

so, in full: std::stop_source is a type that allows a stop request to be made. periodt. πŸ’…

that's the whole description, bestie. sometimes the icon doesn't need a whole paragraph. iykyk.


🌟 Author 🌟

Generated automatically by Doxygen for libstdc++ from the source code. so like, not a human, but the algorithm ate fr fr 😭


and that's the page!! this whole thing lives in the libstdc++ manual, std::stop_source(3), and yes the tools that built it were doing the most. go forth and request your stops responsibly, bestie πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from
  • centos-stream 10: gcc-toolset-15-libstdc++-docs 15.2.1-8.1.el10 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • centos-stream 10: libstdc++-docs 14.4.1-4.el10 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 43: libstdc++-docs 15.2.1-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 43: libstdc++-docs 15.3.1-1.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms