UnwrapOr(FuncT) |
Returns the underlying value when IsSome; or returns lazyFallbackValue() when IsNone.
This is a safe way to unwrap the optional, by explicitly handling the None variant.
Use the eager UnwrapOr(T) variant if the fallback value is cheap or readily available.
C#
|
UnwrapOr(T) |
Returns the underlying value when IsSome; or returns the fallbackValue when IsNone.
This is a safe way to unwrap the optional, by explicitly handling the None variant.
Use the lazy UnwrapOr(FuncT) variant if the computation of the fallback value is expensive.
C#
|