|
|
|
|
|
by mborch
2802 days ago
|
|
What it does have is compile-time parameters where you can bind a type variable during compilation: fn max(comptime T: type, a: T, b: T) T {
if (T == bool) {
return a or b;
} else if (a > b) {
return a;
} else {
return b;
}
}
The type variable isn't used at run-time. |
|