Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![feature(const_generics)]
- use std::default::Default;
- pub struct RawMatrix<T, const N: usize>
- where
- T: Sized + Default + Copy,
- {
- data: [T; {N}],
- }
- impl <T, const N : usize> Default for RawMatrix<T, {N}> where T: Sized + Default + Copy {
- fn default() -> Self {
- RawMatrix::<_, {N}>{data: [T::default(); N] }
- }
- }
- fn main() {
- let matrix = RawMatrix::<u32, 20>::default();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement