std::expected<T,E>::value

If *this contains an expected value, returns a reference to the contained value. Returns nothing for void partial specialization.

# Declarations

Primary template
constexpr T& value() &;

(since C++23)

constexpr const T& value() const&;

(since C++23)

constexpr T&& value() &&;

(since C++23)

constexpr const T&& value() const&&;

(since C++23)

void partial specialization
constexpr void value() const&;

(since C++23)

constexpr void value() &&;

(since C++23)

# Example

This section is incompleteReason: no example

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 3940C++23E was not required to be copy/move-constructible for overloads (5,6)required

# See also