opIndex for type list

data pulverizer data.pulverizer at gmail.com
Mon Aug 24 14:49:12 UTC 2020


On Monday, 24 August 2020 at 14:36:22 UTC, Adam D. Ruppe wrote:
> On Monday, 24 August 2020 at 14:19:14 UTC, data pulverizer 
> wrote:
>> I am trying to implement `opIndex` (e.g. T[i]) for types in a 
>> struct. So for I have `length`:
>
> Can't really do that, the operator overloads work on instances 
> instead of static types.
>
> AliasSeq is magical because it just gives a name to something 
> built-into the compiler.

Fair enough, it's not a show stopper.


More information about the Digitalmars-d-learn mailing list