folly::Unexpected

Unexpected - a helper type used to disambiguate the construction of Expected objects in the error state.

Synopsis

Declared in <folly/Expected.h>

template<class Error>
class [[nodiscard]] Unexpected final

Member Functions

NameDescription
Unexpected [constructor]Constructors
operator= Assignment operators
error Returns the stored error.

Friends

NameDescription
folly::expected_detail::expected_detail_ExpectedHelper::ExpectedHelperStatic helpers implementing the Expected continuation operations.
folly::ExpectedForward declarations
folly::UnexpectedUnexpected - a helper type used to disambiguate the construction of Expected objects in the error state.

Non-Member Functions

NameDescription
makeUnexpectedFor constructing an Unexpected object from an error code. Unexpected objects are implicitly convertible to Expected object in the error state. Usage is as follows:
operator co_awaitEnables co_await on an Unexpected to short-circuit with an error.
operator!=Compares two Unexpected values for inequality.
operator==Compares two Unexpected values for equality.

Return Value

NOTE

The return value should not be discarded.