[#beman-optional-optional-03-or_else-01] = xref:beman.adoc[beman]::xref:beman/optional.adoc[optional]::xref:beman/optional/optional-03.adoc[optional]::or_else :relfileprefix: ../../../ :mrdocs: 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class F> constexpr xref:beman/optional/optional-03.adoc[optional<T>] xref:beman/optional/optional-03/or_else-05.adoc[or_else](F&& f) const &; ---- [.small]#xref:beman/optional/optional-03/or_else-05.adoc[_» more..._]# Returns an optional containing the stored value if it has one, or the result of applying `f` to the optional if it does not. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class F> constexpr xref:beman/optional/optional-03.adoc[optional<T>] xref:beman/optional/optional-03/or_else-04.adoc[or_else](F&& f) &&; ---- [.small]#xref:beman/optional/optional-03/or_else-04.adoc[_» more..._]# == Return Value * optional * optional<T> * auto [.small]#Created with https://www.mrdocs.com[MrDocs]#