mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
@select(
comptime T: type,
pred: std.meta.Vector(len, bool),
a: std.meta.Vector(len, T),
b: std.meta.Vector(len, T)
) std.meta.Vector(len, T)
Constructs a vector from a & b, based on the values in the predicate vector. For indices where the predicate value is true, the corresponding
element from the a vector is selected, and otherwise from b.
25 lines
998 B
25 lines
998 B