Is there a way to disable copying of an alias this'd member? - trying to make a NotNull type

Simen Kjærås simen.kjaras at gmail.com
Fri May 24 12:03:08 UTC 2019


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


More information about the Digitalmars-d-learn mailing list