A simple library for optional values.
To use this package, run the following command in your project's root directory:
Put the following dependency into your project's dependences section:
Option is a library for D. To avoid using
null around the code, it introduce a
Option type which wraps a possible-empty value.
The library provides:
- static methods to create
Optionobject contains a value;
Optionobject does not contain a value;
nullablewhen it is not known a priori whether the value exists or not;
- class methods to retrieve essential informations about the
getto unwrap the value (throws an error when the
isEmptyto know whether the
Optionobject is empty (value not present) or not;
orto retrieve the wrapped value if is present, else the passed value (used as the default value). This method never throws.
- Registered by asperan
- ~main released 10 days ago
- Copyright © 2021, Alex Speranza