opIndexMember

Petar Petar
Tue Dec 29 22:33:01 UTC 2020


On Monday, 28 December 2020 at 20:15:27 UTC, Per Nordlöw wrote:
> On Sunday, 27 December 2020 at 14:46:43 UTC, claptrap wrote:
>> So basically if opIndexMember is defined for Foo then...
>>
>> foo[i].x
>>
>> Is rewritten to..
>>
>> foo.opIndexMember!("x")(i);
>
> For an alternative solution see:
> https://github.com/nordlow/phobos-next/blob/master/src/nxt/soa.d
>
> No benchmarks yet, tough, but you're very welcome to add them.

Here's my own implementation which I dug out from an old project 
of mine from a few years back:

https://gist.github.com/PetarKirov/a074073a12482e761a5e88eec559e5a8


More information about the Digitalmars-d mailing list