std::stop_token(3)

🌸 std::stop_token β€” from the libstdc++ girlies πŸ’…

okay so bestie, welcome to the manual page for std::stop_token ✨ it lives in the Library Functions Manual and it's genuinely one of those little header-only cuties that makes threading not a total nightmare. no cap.


πŸ’– NAME πŸ’–

std::stop_token β€” the lil guy that lets you check whether a stop request has been made on a stop_source. that's it. that's the whole job. and it ate. πŸ‘‘


✨ SYNOPSIS ✨

#include <stop_token>

πŸŽ€ Public Member Functions πŸŽ€

  • stop_token (const stop_token &) noexcept=default β€” copy constructor, defaulted, noexcept, no drama πŸ’–
  • stop_token (stop_token &&) noexcept=default β€” move constructor, also defaulted and noexcept πŸ¦‹
  • stop_token & operator= (const stop_token &) noexcept=default β€” copy assignment, defaulted, noexcept, iconic πŸ’…
  • stop_token & operator= (stop_token &&) noexcept=default β€” move assignment, defaulted, noexcept, slay ✨
  • bool stop_possible() const noexcept β€” tells you if a stop is even possible 🫢
  • bool stop_requested() const noexcept β€” tells you if a stop has actually been requested πŸ‘€
  • void swap(stop_token &__rhs) noexcept β€” swaps with __rhs, noexcept, no notes 🌸

🌈 Friends 🌈

  • bool operator==(const stop_token &__a, const stop_token &__b) β€” comparing two tokens, __a vs __b, equality check πŸ’œ
  • template<typename _Callback> class stop_callback β€” the callback class, templated on _Callback πŸ”₯
  • class stop_source β€” the source itself, the main character of the whole stop situation πŸ‘‘
  • void swap(stop_token &__lhs, stop_token &__rhs) noexcept β€” the free-function swap for __lhs and __rhs, also noexcept ⭐

πŸ’€ Detailed Description πŸ’€

Allow testing whether a stop request has been made on a stop_source. literally that's the vibe check. it's giving "cooperative cancellation but make it cute." πŸ’–


πŸ™ˆ Author πŸ™ˆ

Generated automatically by Doxygen for libstdc++ from the source code. not a human, not a girlie, just a doc generator doing its thing fr fr πŸŽ€


okay that's the whole page bestie 🫢 this was libstdc++'s std::stop_token(3) β€” stay stoppable, stay slay, and remember: the token just tests, it doesn't cancel anything for you. bye 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