[#beman-optional-optional-06-or_else]
= xref:beman.adoc[beman]::xref:beman/optional.adoc[optional]::xref:beman/optional/optional-06.adoc[optional&lt;T&&gt;]::or&lowbar;else
:relfileprefix: ../../../
:mrdocs:

Calls a function if the optional is empty&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class F&gt;
constexpr
xref:beman/optional/optional-06.adoc[optional&lt;T&&gt;]
or&lowbar;else(F&& f) const
requires (std&colon;&colon;invocable&lt;F&gt;);
----

== Description

The return type is the same as the return type of `f,` which must return an optional type&period;

== Return Value

optional

== Template Parameters

[cols="1,4"]
|===
| Name| Description
| *F*
| The type of the invocable
|===

== Parameters

[cols="1,4"]
|===
| Name| Description
| *f*
| The invocable to apply to the contained value
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
