authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2024-09-04 12:31:08 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2024-09-04 12:31:08 -07:00
log4b3e1e5bae70df6595051c6d6199de6caa2b6585
tree096ffd1af889c5b2ad4591112c092e370be11ab3
parent028cd45201b701d558b8527b41366371a06b7a3d

add to_array mixin method


1 files changed, 9 insertions(+), 0 deletions(-)

_x.zig+9
......@@ -24,5 +24,14 @@ pub fn mixin(
2424 x.a = @intFromFloat(in[3]);
2525 return x;
2626 }
27
28 pub fn to_array(x: T, comptime I: type) [4]I {
29 return .{
30 @field(x, @tagName(f1)),
31 @field(x, @tagName(f2)),
32 @field(x, @tagName(f3)),
33 x.a,
34 };
35 }
2736 };
2837}