[#beman-optional-optional-03-and_then-0c] = xref:beman.adoc[beman]::xref:beman/optional.adoc[optional]::xref:beman/optional/optional-03.adoc[optional]::and_then :relfileprefix: ../../../ :mrdocs: Applies a function to the contained value if there is one. == Synopsis Declared in `<beman/optional/optional.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class F> constexpr auto and_then(F&& f) const &; ---- == Description The return type is the same as `std::invoke_result_t<F, T&>`, but wrapped in an optional. The function `f` must return an optional type. == 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]#