What is the equivalent of C++'s std::optional<T> and std::nullopt in D?

Uknown sireeshkodali1 at gmail.com
Tue Apr 3 02:15:09 UTC 2018


On Tuesday, 3 April 2018 at 02:10:09 UTC, helxi wrote:
> For reference: 
> https://en.cppreference.com/w/cpp/utility/optional

Nullable!T would be the closest thing:
https://dlang.org/phobos/std_typecons.html#Nullable

I'm not sure how comparable they are though.


More information about the Digitalmars-d-learn mailing list