std::future...future_error(3)
π 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:
future_error( const future_error& other ) noexcept;(1) (since C++11) β the copy constructor. it initializes the contents of the newfuture_errorobject with those ofother. if*thisandotherboth have dynamic typestd::future_error, thenstd::strcmp(what(), other.what()) == 0. no cap, thatβs the whole vibe. π«Άexplicit future_error( std::future_errc ec );(2) (since C++17) β constructs a newfuture_errorobject containing the error codestd::make_error_code(ec). iconic behavior, honestly. β¨
π Parameters π
otherβ anotherfuture_errorobject 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 afuture_errorother than copying from anotherfuture_errorprior 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
- 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