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

2018-04-03 Thread Timoses via Digitalmars-d-learn

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


See also this topic recently discussed:
https://forum.dlang.org/post/p9qvb8$1j1n$1...@digitalmars.com


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

2018-04-02 Thread Uknown via Digitalmars-d-learn

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.


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

2018-04-02 Thread helxi via Digitalmars-d-learn

For reference: https://en.cppreference.com/w/cpp/utility/optional