Result and Option types

FreeSlave freeslave93 at gmail.com
Sat Jul 25 18:55:26 UTC 2020


On Saturday, 25 July 2020 at 18:06:51 UTC, powerboat9 wrote:
> Does dlang have an analog to Result or Option types from rust?

Standard library has std.typecons.Nullable 
https://dlang.org/phobos/std_typecons.html#Nullable

Note that objects are nullable by themselves as classes are 
reference types.

As for Result it's easy to implement using Tuple and writing some 
additional functions.


More information about the Digitalmars-d-learn mailing list