Nullable with reference types

sigod via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 29 12:29:35 PDT 2015


Hi, everyone.

```
import std.typecons : Nullable;

class Test {}

Nullable!Test test;
assert(test.isNull);
```

Why does `Nullable` allowed to be used with reference types (e.g. 
classes)?

P.S. I have experience with C#, where `Nullable<T>` cannot be 
used with reference types. And it sounds logical to me.


More information about the Digitalmars-d-learn mailing list