folly::Expected::value_or

Returns the stored value, or a default when in the error state.

Synopses

Declared in <folly/Expected.h>

Returns the stored value, or a default when in the error state.

template<class U>
Value
value_or(U&& dflt) const &;
» more...

Returns the stored value, or a default when in the error state.

template<class U>
Value
value_or(U&& dflt) &&;
» more...

Return Value

  • A copy of the value, or dflt.
  • The moved value, or dflt.

Parameters

NameDescription
dfltThe default returned when no value is present.