Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #![feature(const_generics)]
  2.  
  3. struct Foo<T, const N: usize>([T; {N}]);
  4.  
  5. impl<T, const N: usize> Foo<T, {N}> {
  6. fn foo(&self) -> usize {
  7. {N}
  8. }
  9. }
  10.  
  11. fn main() {
  12. let foo = Foo([0u32; 512]);
  13. println!("{:?}", foo.foo());
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement