Velo supports generic classes and functions with type parameters in square brackets. Generics are a compile-time feature with no runtime overhead. |
|
A generic class with a type parameter |
|
Multiple type parameters are separated by commas. |
|
Generic functions infer type arguments automatically from call arguments — no explicit type needed. |
|
A generic container (stack) using arrays. |
|