Closed
Description
I'm working on integrating const generics into stdsimd
. We want to support two types of bit masks. The first has an entire mask per lane, e.g.:
struct Mask32<const LANES: usize>([u32; LANES]);
The other type of mask only uses a single bit per lane, e.g.:
struct BitMask<const LANES: usize>([u8; (LANES + 7) / 8]);
This doesn't work, however, and errors with error: unconstrained generic constant
. After finding #68436, I was able to get it working with:
struct BitMask<const LANES: usize>([u8; (LANES + 7) / 8]) where [u8; (LANES + 7) / 8]: Sized;
This seems inconsistent since the two types are negligibly different. Also, since this type will be public, the bound bleeds into the interface which is undesirable.