[#bsl-optional-072-transform-09d] = xref:bsl.adoc[bsl]::xref:bsl/optional-072.adoc[optional]::transform :relfileprefix: ../../ :mrdocs: `transform` overloads == Synopses Declared in `<bslstl_optional.h>` Map the contained value through `func`, or return an empty optional. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_FUNC> constexpr auto xref:bsl/optional-072/transform-00.adoc[transform](t_FUNC&& func) &; ---- [.small]#xref:bsl/optional-072/transform-00.adoc[_» more..._]# Same as the `transform` overload taking `&`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_FUNC> constexpr auto xref:bsl/optional-072/transform-068.adoc[transform](t_FUNC&& func) const &; ---- [.small]#xref:bsl/optional-072/transform-068.adoc[_» more..._]# Apply the specified `func` to the contained value and return the result as an rvalue optional. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_FUNC> constexpr auto xref:bsl/optional-072/transform-06b.adoc[transform](t_FUNC&& func) &&; ---- [.small]#xref:bsl/optional-072/transform-06b.adoc[_» more..._]# Apply the specified `func` to the contained value and return the result as a const rvalue optional. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_FUNC> constexpr auto xref:bsl/optional-072/transform-097.adoc[transform](t_FUNC&& func) const &&; ---- [.small]#xref:bsl/optional-072/transform-097.adoc[_» more..._]# == Return Value `optional` containing the result of `func`, or empty if disengaged == Parameters [cols="1,4"] |=== | Name| Description | *func* | callable invoked with the contained value or when empty |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#