On Friday, 24 May 2019 at 12:03:08 UTC, Simen Kjærås wrote:
On Friday, 24 May 2019 at 11:40:20 UTC, aliak wrote:
It's ref so that you can do this for e.g.

class C { int i; }
auto a = notNull!C;
a.i = 3;

That's a valid concern for a struct, but classes are already reference types, so you're only adding a new layer of ref-ness. The above will work great with a non-ref alias this.


--
  Simen

Ah true. Yes I guess I can do this for ref types indeed. And maybe I can just constrain it to classes, interfaces and pointers 🤔

Cheers,
- Ali

Reply via email to