Open MaulingMonkey opened 1 year ago
trait Unsigned { const BITS : usize = 8 * size_of::<Self>(); fn bit(i: usize) -> Self { todo!() } } impl Unsigned for u8 {} impl Unsigned for u16 {} impl Unsigned for u32 {} impl Unsigned for u64 {} impl Unsigned for u128 {} impl Unsigned for usize {} struct ChunkAllocator<B: Unsigned, T>(B, [T; B::BITS]); // ?