# Add @select · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/50a29f7c213d4a906839dfd625b6280663348781)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 50a29f7c213d4a906839dfd625b6280663348781

Requested commit: 50a29f7c213d4a906839dfd625b6280663348781

Commit: 50a29f7c213d4a906839dfd625b6280663348781

Tree: f0371b90219e295987d33f6335ad0aeb60fd2f7a

Author: Robin Voetter

Committer: Andrew Kelley

## Message

```
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.

```

## Parents

- [fc105f268149b195ea4a4189da59d40e96e455b4](https://git.cafe/gitcafe/zig/commit/fc105f268149b195ea4a4189da59d40e96e455b4?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/50a29f7c213d4a906839dfd625b6280663348781?format=markdown)
