or_else overloads
Synopses
Declared in <beman/optional/optional.hpp>
Returns an optional containing the contained value if it has one, or the result of applying f to the optional if it does not.
template<class F>
constexpr
optional<T>
or_else(F&& f) const &
requires (std::invocable<F> && std::copy_constructible<T>);
Returns an optional containing the contained value if it has one, or the result of calling f if it does not.
template<class F>
constexpr
optional<T>
or_else(F&& f) &&
requires (std::invocable<F> && std::move_constructible<T>);