Lokathor / tinyvec

Just, really the littlest Vec you could need. So smol.
https://docs.rs/tinyvec
Apache License 2.0
648 stars 49 forks source link

how to create generic arrary #188

Closed kzhui125 closed 6 months ago

kzhui125 commented 7 months ago
fn f1<const N: usize>() {
    let chars: ArrayVec<[char; N]> = ArrayVec::<[char; N]>::default();
}

does Rust support? thanks,

Lokathor commented 6 months ago

Yep, https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=870189d8703a2ea0133249b1950a5f56