Core.Types.Optional (Visera.Core.Types.Optional)¶
Core.Types.Optional provides optional type TOptional
Responsibilities¶
- When HasValue() is true, GetValue() or operator* is safe; otherwise do not dereference.
- Default construct (no value), construct from value, NullOpt, InPlace; copy/move when T supports.
- HasIntrusiveUnsetOptionalState
: when true, T can represent unset via comparison with FIntrusiveUnsetOptionalState for zero-overhead optional string etc.
Main types and constants¶
| Type / Constant | Description |
|---|---|
TOptional<T> |
Optional container; HasValue(), GetValue(), operator*, operator->. |
NullOpt |
Constant for no value; for construct or assign. |
InPlace |
In-place construct tag for TOptional(InPlace, args...). |
FIntrusiveUnsetOptionalState |
Intrusive unset marker type. |
HasIntrusiveUnsetOptionalState<T> |
Trait: whether T supports intrusive unset. |