Struct Optional<T>
Represents an optional value of type T with an enable flag,
allowing you to control whether the value should be considered active.
[Serializable]
public struct Optional<T>
Type Parameters
| Name | Type | Description |
|---|---|---|
T | The type of the optional value. |
Constructors
Optional(T)
Initializes a new instance of the Optional struct with the given value, enabling the optional by default.
public Optional(T initialValue)
Parameters
| Name | Type | Description |
|---|---|---|
initialValue | T | The initial value to store. |
Properties
Enabled
Gets a value indicating whether this optional is enabled.
public bool Enabled { get; }
Property Value
bool