how is this array subtyping inside struct (bug?) possible?

mw mingwu at gmail.com
Mon Aug 10 21:15:58 UTC 2020


On Monday, 10 August 2020 at 20:34:33 UTC, kinke wrote:
>> This does not work:
>
> This does and prints the desired output:
>
> class SharedArray(T)
> {
>   T[] array;
>   alias array this;
>
>   final @disable:
>   T front();
>   void popFront();
>   bool empty();
> }
>
> https://run.dlang.io/is/5ciCue

Thanks. I will accept this as the proper work-around.



More information about the Digitalmars-d mailing list