folly::Optional::value_or

value_or overloads

Synopses

Declared in <folly/Optional.h>

Return a copy of the value if set, or a given default if not. methodset Getters

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

Return the value if set, or a given default if not. methodset Getters

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

Return Value

The contained value if present, otherwise dflt.

Parameters

NameDescription
dfltThe default value to return when empty.