soa-derive icon indicating copy to clipboard operation
soa-derive copied to clipboard

Const array SoA variant

Open bonsairobo opened this issue 3 years ago • 2 comments

I think it would be nice to generate a type like:

pub struct FooArray<const N: usize> {
    pub f1: [f32; N],
    pub f2: [u8; N],
    ...
}

This would allow you to do stuff like core::alloc::Layout::new::<FooArray<128>>() for free.

bonsairobo avatar Feb 26 '22 23:02 bonsairobo

Agrees that this could be nice to do, but I don't have time to implement this myself. If someone wants to contribute this, I can take some time to review PR.

Luthaf avatar Mar 01 '22 09:03 Luthaf

Sadly this particular feature ended up being a mismatch for my problem, so I don't have a good reason to implement it.

bonsairobo avatar Mar 01 '22 18:03 bonsairobo