ona/src/coral/slots.zig
kayomn fac0470a4a
Some checks failed
continuous-integration/drone/push Build is failing
Major re-write to use asynchronous running loop
2024-05-29 19:27:02 +01:00

24 lines
521 B
Zig

const slices = @import("./slices.zig");
const std = @import("std");
pub fn Parallel(comptime Value: type) type {
const Slices = slices.Parallel(Value);
const alignment = @alignOf(Value);
return struct {
allocator: std.mem.Allocator,
slices: slices.Parallel(Value) = .{},
const Self = @This();
pub fn len(self: Self) usize {
return self.slices.len;
}
pub fn values(self: *Self, comptime field: Slices.Field) []align (alignment) Slices.Element(field) {
return self.slices.slice(field);
}
};
}