std::expect...::has_value(3)
β¨ NAME β¨
std::expected::operatorbool,std::expected::has_value β std::expected::operatorbool,std::expected::has_value
Okay bestie, welcome to the std::expect...::has_value(3) page from the C++ Standard Libary manual π this one is all about checking whether your std::expected is holding an expected value β very main character energy, no cap.
πΈ Synopsis πΈ
constexpr explicit operator bool() const noexcept; (since C++23)
constexpr bool has_value() const noexcept; (since C++23)
Checks whether *this contains an expected value. That's the whole vibe check β¨
π Parameters π
(none) β no arguments, no extras, literally nothing to pass. Nada π«Ά
π Return value π
trueif*thiscontains an expected valuefalseif*thiscontains an unexpected value
π¦ Notes π¦
A std::expected object is never empty. If has_value() returns true, operator* can be used to access the contained value; otherwise, error() can be used.
π₯ Example π₯
This section is incomplete Reason: no example
Category: * Todo no example
π See also π
operator->accesses the expected valueoperator*(public member function)errorreturns the unexpected value (public member function)
That's the whole page, bestie π«Ά signing off from http://cppreference.com on 2024.06.10 β this was std::expect...::has_value(3), 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