boostorg / boostorg/compute

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

未关闭
#44 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
feature
主要语言
C++
星标
1.7k
派生
340
PR 合并指标
30 天内没有已合并 PR

描述

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).
##

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。