Struct Optional<T>
Assembly: cs.temp.dll.dll
Syntax
[AlgoApiFormatter(typeof(OptionalFormatter<>))]
[Serializable]
public struct Optional<T> : IEquatable<Optional<T>> where T : struct, IEquatable<T>
Type Parameters
Constructors
Optional(T)
Declaration
Parameters
Type |
Name |
Description |
T |
value |
|
Fields
HasValue
Declaration
Field Value
Value
Declaration
Field Value
Properties
Empty
Declaration
public static Optional<T> Empty { get; }
Property Value
Methods
Else(T)
Declaration
public T Else(T defaultValue)
Parameters
Type |
Name |
Description |
T |
defaultValue |
|
Returns
Equals(Optional<T>)
Declaration
public bool Equals(Optional<T> other)
Parameters
Returns
Operators
Implicit(T to Optional<T>)
Declaration
public static implicit operator Optional<T>(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
Returns
Implicit(Optional<T> to T)
Declaration
public static implicit operator T(Optional<T> optional)
Parameters
Type |
Name |
Description |
Optional<T> |
optional |
|
Returns
Implicit(Optional<T> to Nullable<T>)
Declaration
public static implicit operator T? (Optional<T> optional)
Parameters
Type |
Name |
Description |
Optional<T> |
optional |
|
Returns