Constructs an Optional!T value by assigning T
Assigns a value to the optional or sets it to none.
If the optional is some value it returns an optional of some value op rhs
If the optional is some value it returns an optional of some lhs op value
If there's a value that's callable it will be called else it's a noop
Provides indexing into arrays
Compare two optionals or an optional with some value
Provides indexing into arrays
If the optional is some value, op assigns rhs to it
Provides indexing into arrays
Applies unary operator to internal value of optional.
Converts value to string
Optional type. Also known as a Maybe or Option type in some languages.
This can either contain a value or be none. If the value is a refernce type then null is considered none.
It also has range like behavior. So this acts as a range that contains 1 element or is empty.
And all operations that can be performed on a T can also be performed on an Optional!T. The behavior of applying an operation on a no-value or null pointer is well defined and safe.