std::future_category(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ¦‹ std::future_category(3) πŸ¦‹

okay bestie, welcome to the C++ Standard Libary manual page for std::future_category(3) β€” no cap, that’s the title and the manual name right there. And yes, this is the function page, not some β€œfuture vibes” category, iykyk.

πŸ’– NAME πŸ’–

std::future_category β€” literally std::future_category. Self-titled, iconic, main character energy fr fr.

✨ Synopsis ✨

Defined in header <future>

const std::error_category& future_category() noexcept;  (since C++11)

So here’s the tea: this function obtains a reference to the static error category object for the errors related to futures and promises. 🫢

The object is required to override the virtual function error_category::name() to return a pointer to the string "future". It is used to identify error codes provided in the exceptions of type std::future_error.

🫢 Parameters 🫢

  • (none) β€” bestie, there are literally no parameters. Not a single one. Slay.

πŸ”₯ Return value πŸ”₯

A reference to the static object of unspecified runtime type, derived from std::error_category. That’s it, that’s the whole return value. πŸ’…

😭 Example 😭

This section is incomplete Reason: no example

Not me crying over the missing example 😭. The page itself says it’s incomplete, so we’re not inventing one.

πŸ‘‘ See also πŸ‘‘

  • future_errc β€” identifies the future error codes (C++11) (enum)
  • future_error β€” reports an error related to futures or promises (C++11) (class)
  • error_category β€” base class for error categories (C++11) (class)

πŸŽ€ Category πŸŽ€

  • Todo no example

mwah πŸ’‹ β€” this page’s source/version is http://cppreference.com, dated 2024.06.10. bye bestie, go forth and future-category responsibly 🌈✨

πŸ“¦ where this page comes from