util::Result::value_or

Returns the held value, or a fallback when the result holds an error.

Synopsis

Declared in <util/result.h>

template<class U>
T
value_or(U&& default_value) const &;

Return Value

the stored value if present, otherwise default_value

Parameters

NameDescription
default_valuethe value returned when no value is held