Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![feature(const_generics)]
- struct Foo<T, const N: usize>([T; {N}]);
- impl<T, const N: usize> Foo<T, {N}> {
- fn foo(&self) -> usize {
- {N}
- }
- }
- fn main() {
- let foo = Foo([0u32; 512]);
- println!("{:?}", foo.foo());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement