Impose structure on array

Dennis dkorpel at gmail.com
Mon May 20 12:40:38 UTC 2019


On Monday, 20 May 2019 at 12:09:02 UTC, Alex wrote:
> void* data;
>
> auto x = cast(byte[A,B,C])data;
>
> X is then an AxBxC matrix.

It sounds like you're looking for ndslide from mir
http://code.dlang.org/packages/mir-algorithm

```
ubyte data[];
auto x = x.sliced(A, B, C);
```

It should be pretty efficient, but I'm not certain whether it's 
as good as your hand-written code.


More information about the Digitalmars-d-learn mailing list