boostorg / boostorg/compute

Add .x, .y, .z accessors to vector types

Open
#44 1 comment 0 reactions 0 assignees View on GitHub
feature
Dominant language
C++
Stars
1.7k
Forks
340
PR merge metrics
No merged PRs in 30d

Description

Make is possible to access components of vector types (e.g. `float4_`, `int8_`) by names (e.g. `.x`, `.y`).

For example, this should be possible:

```
boost::compute::float4_ v;
v.x = 1;
v.y = 2;
v.z = 3;
v.w = 4;
assert(v == boost::compute::float4_(1, 2, 3, 4));
```

Note that names should only be available if the type actually has enough values (e.g. `float2_` should not have a `.z` field).
##

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.