struct Optional<T>
Description
Optional<T> is a type with one extra value than T, this extra value is used to represent a “missing” or “invalid” T. This extra value is called none.
none can be compared against with the operators == or !=.
An Optional<T> value can also be implicitly or explicitly constructed from a value of type T
Optional<T> values can be deconstructed with if(let myT=myOptionalT)… where this branch will only be taken if myOptionalT contains a value of type T (to be put into scope as myT).
Generic Parameters
T
Properties
hasValue
Return true iff this Optional contains a value of type T
value
If this Optional contains a value of type T return that.