Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

const generics in rust

struct ArrayPair<T, const N: usize> {
    left: [T; N],
    right: [T; N],
}

impl<T: Debug, const N: usize> Debug for ArrayPair<T, N> {
    // ...
}
Source by blog.rust-lang.org #
 
PREVIOUS NEXT
Tagged: #const #generics #rust
ADD COMMENT
Topic
Name
3+1 =