22 General utilities library [utilities]

22.8 Expected objects [expected]

22.8.7 Partial specialization of expected for void types [expected.void]

22.8.7.6 Observers [expected.void.obs]

constexpr explicit operator bool() const noexcept; constexpr bool has_value() const noexcept;
Returns: has_­val.
constexpr void operator*() const noexcept;
Preconditions: has_­value() is true.
constexpr void value() const &;
Throws: bad_­expected_­access(error()) if has_­value() is false.
constexpr void value() &&;
Throws: bad_­expected_­access(std​::​move(error())) if has_­value() is false.
constexpr const E& error() const & noexcept; constexpr E& error() & noexcept;
Preconditions: has_­value() is false.
Returns: unex.
constexpr E&& error() && noexcept; constexpr const E&& error() const && noexcept;
Preconditions: has_­value() is false.
Returns: std​::​move(unex).