You can use static[int]. If you want to use array in runtime, maybe use
UncheckedArray[int] or just seq[int]
type
MatchPool[N: static[int]] = object # Here, N is an integer
vals: array[N, int]
var mp = MatchPool[3](vals: [2, 4, 1])
Run
- How to use integer generics in types? adnan
- Re: How to use integer generics in types? xflywind
- How to use integer generics in types? stevejock1
