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
T
value_or(U&& u) &&;

Return Value

T

Template Parameters

Name Description
U The type of the alternate value

Parameters

Name Description
u The value to return in the empty case

Created with MrDocs