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
Ditto Ditto
Compare two optionals or an optional with some value
Provides indexing into arrays
If the optional is some value, op assigns rhs to it
Applies unary operator to internal value of optional.
Allows you to create an Optional type in place.
Optional type. Also known as a Maybe or Option type in some languages.
This can either contain a value or be none. It works with any value, including values that can be null. I.e. null is a valid value that can be contained inside an optional if T is a pointer type
It also has range like behavior. So this acts as a range that contains 1 element or is empty. Similar to std.algorithm.only
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.