[#bsl-optional-072-or_else-09] = xref:bsl.adoc[bsl]::xref:bsl/optional-072.adoc[optional]::or_else :relfileprefix: ../../ :mrdocs: Return this optional if engaged; otherwise invoke `func`. == Synopses Declared in `<bslstl_optional.h>` Return this optional if engaged; otherwise invoke `func`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_FUNC> constexpr xref:bsl/optional-072.adoc[optional<t_TYPE>] xref:bsl/optional-072/or_else-0b.adoc[or_else](t_FUNC&& func) const & requires conjunction_v<std::is_invocable<t_FUNC>, std::is_copy_constructible<t_TYPE>>; ---- [.small]#xref:bsl/optional-072/or_else-0b.adoc[_» more..._]# Return this optional if engaged; otherwise invoke `func`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_FUNC> constexpr xref:bsl/optional-072.adoc[optional<t_TYPE>] xref:bsl/optional-072/or_else-03.adoc[or_else](t_FUNC&& func) && requires conjunction_v<std::is_invocable<t_FUNC>, std::is_move_constructible<t_TYPE>>; ---- [.small]#xref:bsl/optional-072/or_else-03.adoc[_» more..._]# == Return Value this optional if engaged, otherwise the result of `func` == Parameters [cols="1,4"] |=== | Name| Description | *func* | callable invoked with the contained value or when empty |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#