Does "const generics" essentially mean singleton types?
struct RectangularArray<T, const WIDTH: usize, const HEIGHT: usize> {
array: [[T; WIDTH]; HEIGHT],
}
const X: usize = 7;
fn main() {
let x: RectangularArray<i32, 2, 4>;
let y: RectangularArray<i32, X, {2 * 2}>;
}
I haven't read enough about singleton types to know the exact details about their similarities, so I'm not sure.Fully general dependent type would allow passing in runtime values, which is significantly harder to type-check and execute