std::thread::id(3)
π§΅ std::thread::id(3) π§΅
okay bestie, this is the std::thread::id(3) page from the C++ Standard Libary manual, and we are about to make this tiny ID class make sense. no cap. π
π NAME π
std::thread::id - std::thread::id
(Yes, the NAME line is literally std::thread::id on both sides. we keep the facts exactly as they are, even when they're silly. π)
π Synopsis π
Defined in header <thread>
class thread::id; (since C++11)
The class thread::id is a lightweight, trivially copyable class that serves as a unique identifier of std::thread and std::jthread (since C++20) objects. π¦
Instances of this class may also hold the special distinct value that does not represent any thread. Once a thread has finished, the value of std::thread::id may be reused by another thread. that's important, bestie β IDs are not forever stickers. π«Ά
This class is designed for use as key in associative containers, both ordered and unordered. so yes, it's giving "put me in a map" energy. π₯
π Member functions π
constructorβ constructs an id that does not represent a thread(public member function)
π¦ Non-member functions π¦
okay the non-member section is lowkey doing an annotation tornado, so I'm keeping the exact order and every little crumb:
operator==operator!=operator<operator<=operator>operator>=β next to this the page sayscompares two thread::id objectsoperator<=>β(function)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)operator<<β serializes athread::idobject(function template)
That's the whole cluster. The vibes are chaotic but the facts are intact. π
πΈ Helper classes πΈ
std::hash<std::thread::id>β hash support forstd::thread::id(C++11)(class template specialization)std::formatter<std::thread::id>β formatting support forthread::id(C++23)(class template specialization)
π See also π
get_idβ returns the id of the thread(public member function)get_idβ returns the thread id of the current thread(C++11)(function)
π okay that's the whole page, bestie. source: http://cppreference.com, version/date: 2024.06.10, and the page is std::thread::id(3). slay, you're now an ID girlie. πβ¨
π¦ 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