[#bsl-optional-072-and_then-08d] = xref:bsl.adoc[bsl]::xref:bsl/optional-072.adoc[optional]::and_then :relfileprefix: ../../ :mrdocs: `and_then` overloads == Synopses Declared in `<bslstl_optional.h>` Invoke `func` on the contained value, or return an empty optional. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_FUNC> constexpr auto xref:bsl/optional-072/and_then-06.adoc[and_then](t_FUNC&& func) &; ---- [.small]#xref:bsl/optional-072/and_then-06.adoc[_» more..._]# Invoke the specified `func` on the contained value and return its optional result as a const lvalue. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_FUNC> constexpr auto xref:bsl/optional-072/and_then-080.adoc[and_then](t_FUNC&& func) const &; ---- [.small]#xref:bsl/optional-072/and_then-080.adoc[_» more..._]# Invoke the specified `func` on the contained value and return its optional result as an rvalue. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_FUNC> constexpr auto xref:bsl/optional-072/and_then-09.adoc[and_then](t_FUNC&& func) &&; ---- [.small]#xref:bsl/optional-072/and_then-09.adoc[_» more..._]# Invoke the specified `func` on the contained value and return its optional result as a const rvalue. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_FUNC> constexpr auto xref:bsl/optional-072/and_then-04.adoc[and_then](t_FUNC&& func) const &&; ---- [.small]#xref:bsl/optional-072/and_then-04.adoc[_» more..._]# == Return Value result of `func` if engaged, otherwise an empty optional == Parameters [cols="1,4"] |=== | Name| Description | *func* | callable invoked with the contained value or when empty |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#