beman::optional::optional::value_or

Returns the contained value if there is one, otherwise returns u.

Synopsis

Declared in <beman/optional/optional.hpp>

template<class U = std::remove_cv_t<T>>
constexpr
std::remove_cv_t<T>
value_or(U&& u) &&;

Return Value

T

Template Parameters

NameDescription
UThe type of the alternate value

Parameters

NameDescription
uThe value to return in the empty case