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

kinke noone at nowhere.com
Mon Aug 10 20:34:33 UTC 2020


On Monday, 10 August 2020 at 20:13:42 UTC, mw wrote:
>> class SharedArray!T
>> {
>>    T[] array;
>>    alias array this;
>>
>>    @disable:
>>       front();
>>       popFront();
>>       empty();
>> }
>
> 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


More information about the Digitalmars-d mailing list