aboutsummaryrefslogtreecommitdiff
path: root/test/behavior.zig
diff options
context:
space:
mode:
authorRobin Voetter <robin@voetter.nl>2021-07-26 02:37:11 +0200
committerAndrew Kelley <andrew@ziglang.org>2021-07-26 20:05:48 -0400
commit50a29f7c213d4a906839dfd625b6280663348781 (patch)
treef0371b90219e295987d33f6335ad0aeb60fd2f7a /test/behavior.zig
parentfc105f268149b195ea4a4189da59d40e96e455b4 (diff)
downloadzig-50a29f7c213d4a906839dfd625b6280663348781.tar.gz
zig-50a29f7c213d4a906839dfd625b6280663348781.zip
Add @select
@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.
Diffstat (limited to 'test/behavior.zig')
-rw-r--r--test/behavior.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/behavior.zig b/test/behavior.zig
index 0055638335..8459e499d7 100644
--- a/test/behavior.zig
+++ b/test/behavior.zig
@@ -118,6 +118,7 @@ test {
_ = @import("behavior/ref_var_in_if_after_if_2nd_switch_prong.zig");
_ = @import("behavior/reflection.zig");
_ = @import("behavior/shuffle.zig");
+ _ = @import("behavior/select.zig");
_ = @import("behavior/sizeof_and_typeof.zig");
_ = @import("behavior/slice.zig");
_ = @import("behavior/slice_sentinel_comptime.zig");