std::optional::value_or (3) Linux Manual Page
std::optional<T>::value_or – std::optional<T>::value_or Synopsis template <class U> (since C++ 17) constexpr T value_or(U &&default_value) const &; template <class U> (since C++ 17) constexpr T value_or(U &&default_value) &&; Returns the contained value if *this has a value, otherwise returns default_value. 1) Equivalent to bool(*this) ? **this : static_cast<T>(std::forward<U>(default_value)) 2) Equivalent to bool(*this) ? std::move(**this) : static_cast<T>(std::forward<U>(default_value))…
