authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-01-18 23:52:51 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-01-18 23:52:51 -08:00
log53ec18c2b1f857daa22da6ab37694eeaeda3911e
tree4784b862ceb73bf74b6fc4128416914f688afd60
parent518ffdd4b7e14c00aac078f9d19991de5b43b68a

StructOfSlices: support tuples


1 files changed, 3 insertions(+), 2 deletions(-)

src/StructOfSlices.zig+3-2
......@@ -4,7 +4,8 @@ const extras = @import("./lib.zig");
44const expectSimilarType = extras.expectSimilarType;
55
66pub fn StructOfSlices(T: type) type {
7 const fields = std.meta.fields(T);
7 const info = @typeInfo(T).@"struct";
8 const fields = info.fields;
89 var new_fields: [fields.len]std.builtin.Type.StructField = undefined;
910 for (fields, 0..) |item, i| {
1011 new_fields[i] = .{
......@@ -21,7 +22,7 @@ pub fn StructOfSlices(T: type) type {
2122 .backing_integer = null,
2223 .fields = result,
2324 .decls = &.{},
24 .is_tuple = false,
25 .is_tuple = info.is_tuple,
2526 }));
2627}
2728