Generics. Part 4

Const generics

const generics identical to C++ template parameters. With const generics you can do a lot of things e.g declare SmallVector type that will have some limit:

struct SmallVector<T,var COUNT: int> {
    var array: T[COUNT];
}

var vector = SmallVector<int,32>();

Last updated