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

Synopses

Declared in <beman/optional/optional.hpp>

Returns an optional containing the stored 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);

Returns an optional containing the stored 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);

Return Value

  • auto

  • optional<T>

  • optional

Template Parameters

Name

Description

F

T

Parameters

Name

Description

f

Created with MrDocs