Calls a function if the optional is empty.
<beman/optional/optional.hpp>
template<class F>
constexpr
optional<T&>
or_else(F&& f) const;
The return type is the same as the return type of f, which must return an optional type.
| Name | Description |
|---|---|
| F | The type of the invocable |
| Name | Description |
|---|---|
| f | The invocable to apply to the contained value |