A interface to represent an optional value.
Return value if this is the Just!T instance, otherwise throw Exception.
Return true if this is the Just!T instance, otherwise false.
Return true if this is the Nothing!T instance, otherwise false.
A factory method to create Just(T) instance.
A factory method to create Nothing(T) instance.
1 auto maybe = Maybe!int.just(42); 2 if (maybe.isJust) 3 { 4 writeln(maybe.fromJust()); 5 }
Output:
42
See Implementation
A interface to represent an optional value.