beman::optional::optional::or_else

or_else overloads

Synopses

Declared in <beman/optional/optional.hpp>

Returns an optional containing the contained value if it has one, or the result of applying f to the optional if it does not.

template<class F>
constexpr
optional<T>
or_else(F&& f) const &;
» more...

Returns an optional containing the contained value if it has one, or the result of calling f if it does not.

template<class F>
constexpr
optional<T>
or_else(F&& f) &&;
» more...

Return Value

Template Parameters

Name Description
F An invocable type returning an optional.

Parameters

Name Description
f The invocable to call if the optional is disengaged.

Created with MrDocs