[#beman-optional-optional-03-and_then-08]
= xref:beman.adoc[beman]::xref:beman/optional.adoc[optional]::xref:beman/optional/optional-03.adoc[optional]::and&lowbar;then
:relfileprefix: ../../../
:mrdocs:

Applies a function to the contained value if there is one&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
auto
and&lowbar;then(F&& f) const &amp;&amp;;
----

== Description

The return type is the same as `std&colon;&colon;invoke&lowbar;result&lowbar;t&lt;F, T&amp;&gt;`, but wrapped in an optional&period; The function `f` must return an optional type&period;

== Return Value

auto

== 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]#
