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
- 2.0.2 released 2 years ago
- Copyright © 2021, Alex Speranza