std::future...future_error(3)

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

πŸ’– NAME πŸ’–

okay so bestie, this is the std::future...future_error(3) page from the C++ Standard Libary β€” specifically all about std::future_error::future_error, the constructor for std::future_error. it’s giving β€œsmall error object, very important job” energy. πŸ’…βœ¨


🌸 Synopsis 🌸

future_error( const future_error& other ) noexcept; (1) (since C++11)
explicit future_error( std::future_errc ec );       (2) (since C++17)

two constructors, two eras, one little error type. keep your eyes on the version tags, bestie:

  1. future_error( const future_error& other ) noexcept; (1) (since C++11) β€” the copy constructor. it initializes the contents of the new future_error object with those of other. if *this and other both have dynamic type std::future_error, then std::strcmp(what(), other.what()) == 0. no cap, that’s the whole vibe. 🫢
  2. explicit future_error( std::future_errc ec ); (2) (since C++17) β€” constructs a new future_error object containing the error code std::make_error_code(ec). iconic behavior, honestly. ✨

πŸŽ€ Parameters πŸŽ€

  • other β€” another future_error object to copy. literally the one getting copied. πŸ’–
  • ec β€” error code. the little error-code moment. πŸ“

🐚 Notes 🐚

πŸ’€ real talk: there is no standard-compliant way for the user to construct a future_error other than copying from another future_error prior to C++17.

C++11 and C++14 depict an exposition-only public constructor taking a std::error_code, and some implementations provide such a constructor. so yeah β€” not standard, but sometimes it’s out there living its truth. πŸ™ˆβœ¨


mwah πŸ’‹ this little manpage came from http://cppreference.com, the 2024.06.10 version/date situation, and it’s the std::future...future_error(3) page. byeee 🫢🌈

πŸ“¦ where this page comes from