[#BloombergLP-bslstl-Optional_Base-05-value_or-09] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional_Base]::value_or :relfileprefix: ../../../ :mrdocs: Return a copy of the underlying object of a (template parameter) `t_TYPE` if this object is non‐null, and the specified `value` converted to `t_TYPE` otherwise. Note that this method returns _by_ _value_, so may be inefficient in some contexts. == Synopsis Declared in `<bslstl_optional.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_ANY_TYPE> t_TYPE value_or(t_ANY_TYPE&& value) &&; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#