We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d1e297 commit 1964034Copy full SHA for 1964034
sycl/include/CL/sycl/types.hpp
@@ -1242,10 +1242,16 @@ class SwizzleOp {
1242
1243
// Begin hi/lo, even/odd, xyzw, and rgba swizzles.
1244
private:
1245
- // Indexer used in the swizzles.def. C++14
+ // Indexer used in the swizzles.def. C++11 way, a bit more verbose
1246
+ // than C++14 way.
1247
+ struct IndexerHelper {
1248
+ static const constexpr int IDXs[] = {Indexes...};
1249
+ static constexpr int get(int index) {
1250
+ return IDXs[index >= getNumElements() ? 0 : index];
1251
+ }
1252
+ };
1253
static constexpr int Indexer(int index) {
- const constexpr int IDXs[] = {Indexes...};
- return IDXs[index >= getNumElements() ? 0 : index];
1254
+ return IndexerHelper::get(index);
1255
}
1256
1257
public:
0 commit comments