1 2 3 4 5 6 7 8 9 10 11 12
use std::ops::IndexMut; pub trait Array: IndexMut<usize> where Self::Output: Sized, { const SIZE: usize; } impl<Item, const SIZE: usize> Array for [Item; SIZE] { const SIZE: usize = SIZE; }
1 2 3 4 5 6 7 8 9 10 11 12
use std::ops::IndexMut; pub trait Array: IndexMut<usize> where Self::Output: Sized, { const SIZE: usize; } impl<Item, const SIZE: usize> Array for [Item; SIZE] { const SIZE: usize = SIZE; }