std::expected::error(3)
π
std::expected::error(3) π
okay bestie, welcome to the C++ Standard Libary manual page for std::expected::error(3). Yes, the header spells it "Libary" β I'm not fixing it, I'm respecting the source. Lowkey iconic. Highkey a mood. π«Ά
πΈ NAME πΈ
std::expected::error β and the NAME section literally says std::expected::error again. Same energy, fr fr. Periodt. π
β¨ Synopsis β¨
Here are the overloads, all constexpr and all noexcept:
constexpr const E& error() const& noexcept; (1) (since C++23)
constexpr E& error() & noexcept; (2) (since C++23)
constexpr const E&& error() const&& noexcept; (3) (since C++23)
constexpr E&& error() && noexcept; (4) (since C++23)
It accesses the unexpected value contained in *this. That's the vibe.
β οΈ The behavior is undefined ifthis->has_value()istrue. Not a cute little oopsie β this is undefined behavior, bestie. That warning is the main character. π
π₯ Parameters π₯
(none) β no parameters, bestie. Zero. None. β¨
π Return value π
The return value is a reference to the unexpected value contained in *this. That's it, and it ate. π
π§ͺ Example π§ͺ
This section is incomplete. Reason: no example. π Not me showing up to an example section with zero example β the audacity β but that's literally what the page says. π«
π See also π
operator->β accesses the expected valueoperator*β(public member function)valueβ returns the expected value(public member function)operator boolβ checks whether the object contains an expected valuehas_valueβ(public member function)
π·οΈ Category π·οΈ
Todoβno example
π That's the page, bestie. Source/version: http://cppreference.com Β· date: 2024.06.10 Β· page: std::expected::error(3). Slay, bye! π
π¦ 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