|
|
|
|
|
by throwawaymaths
449 days ago
|
|
well, not quite since you can pass non-type things of generally any level of data type complexity (as long as it's comptime-valid, which only excludes certain types of mutation), and do stuff with them that you couldnt in c++. fn MyType(T: type, comptime tag: [] u8, comptime count: usize) type {
const capitalized = some_module.capitalize(tag);
return struct{
fn name() []const u8 {
return capitalized;
}
array: [count]T,
};
}
for example |
|