[#beman-optional-optional-06-and_then] = xref:beman.adoc[beman]::xref:beman/optional.adoc[optional]::xref:beman/optional/optional-06.adoc[optional<T&>]::and_then :relfileprefix: ../../../ :mrdocs: Applies a function to the stored 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 [,cpp] ---- {std::invoke_result_t}, but wrapped in an optional. The function \p f must return an optional type. ---- == Return Value auto [.small]#Created with https://www.mrdocs.com[MrDocs]#