SysTutorials

Linux Manual Pages › Section 3

stdvariantvalueless_by_exception(3)

std::variant<Types…>::valueless_by_exception - std::variant<Types…>::valueless_by_exception

Synopsis

constexpr bool valueless_by_exception() const noexcept; (since C++17) Returns false if and only if the variant holds a value.

Notes

A variant may become valueless in the following situations: