Structure of Arrays vs Array of Structures

Per Nordlöw per.nordlow at gmail.com
Mon Aug 26 09:58:30 UTC 2019


On Monday, 26 August 2019 at 09:54:30 UTC, Per Nordlöw wrote:
> I have made some significant optimizations with regards to 
> compilation performance at
>
> https://github.com/nordlow/phobos-next/blob/master/src/soa.d

What is the preferred way to implement to support foreach over 
`x` in

     struct S { int i; float f; }
     auto x = SOA!S();
     foreach (S; x[])
     {
     }

?

Implement `opSlice` that returns a SOA.Range type?


More information about the Digitalmars-d-learn mailing list