[#beman-optional-optional-06-value_or] = xref:beman.adoc[beman]::xref:beman/optional.adoc[optional]::xref:beman/optional/optional-06.adoc[optional<T&>]::value_or :relfileprefix: ../../../ :mrdocs: Returns the contained value if there is one, otherwise returns `u`. == Synopsis Declared in `<beman/optional/optional.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class U = std::remove_cv_t<T>> requires (std::is_object_v<T> && !std::is_array_v<T>) constexpr std::decay_t<T> value_or(U&& u) const; ---- == Return Value std::remove_cv_t<T> == Template Parameters [cols="1,4"] |=== |Name|Description | *U* | The type of the alternate value |=== == Parameters [cols="1,4"] |=== |Name|Description | *u* | The value to return in the empty case |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#