Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
pub fn main() !void {
|
||||
var array = [_]i32{1, 2, 3};
|
||||
apply(@TypeOf(array[0]), array[0..], func);
|
||||
}
|
||||
|
||||
fn apply(comptime T: type, a: []T, f: fn(T) void) void {
|
||||
for (a) |item| {
|
||||
f(item);
|
||||
}
|
||||
}
|
||||
|
||||
fn func(a: i32) void {
|
||||
const std = @import("std");
|
||||
std.debug.print("{d}\n", .{a-1});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue