std::experi...damentalsTS)(3)
hey bestie π you're reading std::experi...damentalsTS)(3) from the C++ Standard Libary manual, and ngl we're gonna make it make sense. no cap.
πΈ NAME πΈ
okay so the NAME line is literally std::experimental::promise(libraryfundamentalsTS) - std::experimental::promise(libraryfundamentalsTS). yep, same string twice, it's giving main character energy π
.
β¨ Synopsis β¨
first thing: this whole thing is defined in header <experimental/future> π¦
template< class R > class promise; (1) (library fundamentals TS)
template< class R > class promise<R&>; (2) (library fundamentals TS)
template<> class promise<void>; (3) (library fundamentals TS)
so std::experimental::fundamentals_v1::promise (and std::experimental::fundamentals_v2::promise) is a modified version of std::promise provided by the library fundamentals TS with support for type-erased allocators. fr fr β¨
π Member types π
- Member type:
allocator_typeβ Definition:std::experimental::erased_type. cute.
π Member functions π
constructorβ constructs the promise object (public member function).get_memory_resourceβ retrieves a pointer to the memory resource used by this object to allocate memory (public member function).
π¦ Non-member function π¦
std::experimental::swap(std::experimental::promise)β specializes theswapalgorithm (function template).
π§ Helper classes π§
std::uses_allocator<std::experimental::promise>β specializes thestd::uses_allocatortype trait (class template specialization).
π«Ά Members identical to std::promise π«Ά
vibe check: these ones are literally identical to std::promise, so you already know the drill:
π Member functions π
destructorβ destructs the promise object (public member function ofstd::promise<R>).operator=β assigns the shared state (public member function ofstd::promise<R>).swapβ swaps two promise objects (public member function ofstd::promise<R>).
π Getting the result π
get_futureβ returns a future associated with the promised result (public member function ofstd::promise<R>).
π₯ Setting the result π₯
set_valueβ sets the result to specific value (public member function ofstd::promise<R>).set_value_at_thread_exitβ sets the result to specific value while delivering the notification only at thread exit (public member function ofstd::promise<R>).set_exceptionβ sets the result to indicate an exception (public member function ofstd::promise<R>).set_exception_at_thread_exitβ sets the result to indicate an exception while delivering the notification only at thread exit (public member function ofstd::promise<R>).
okay bestie, that's the whole manual page, slay π source: http://cppreference.com, dated 2024.06.10. mwah π«Ά
π¦ 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