You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C++23 has views::chunk, which converts a view into a range of views of some size, plus a remainder. This is essentially what simd_split does on std::simd. Unfortunately the name split in simd does something different to views::split, which creates a range of views using a delimiter, which introduces a mismatch in naming. I think simd_chunk might be a better name for what is currently simd_split, as it more closely matches how that name is already being used.
Similarly, simd_cat is doing essentially the same thing as views::join - converting a range of views into a single flat view. Unfortunately the string "cat" is also being used by strcat to do the same thing on strings, so this raises a small ambiguity here. However, if ranges and views are the future, then maybe simd_cat is better named simd_join to more closely relate to them?
The text was updated successfully, but these errors were encountered:
Incidentally, in 1928R7, section "basic_simd and basic_simd_mask creation", the first template has a parameter T, but later uses V instead. Both should be the same. But it did get me thinking why a full simd type should be given to simd_split anyway? Why not just the size of the thing to split, rather than a type? To me it feels that the programmer has to work harder to use it; the compiler is already told the element type through the parameter, so why specify it again. I think this would be neater:
C++23 has
views::chunk
, which converts a view into a range of views of some size, plus a remainder. This is essentially whatsimd_split
does onstd::simd
. Unfortunately the namesplit
insimd
does something different toviews::split
, which creates a range of views using a delimiter, which introduces a mismatch in naming. I thinksimd_chunk
might be a better name for what is currentlysimd_split
, as it more closely matches how that name is already being used.Similarly,
simd_cat
is doing essentially the same thing asviews::join
- converting a range of views into a single flat view. Unfortunately the string "cat" is also being used bystrcat
to do the same thing on strings, so this raises a small ambiguity here. However, if ranges and views are the future, then maybesimd_cat
is better namedsimd_join
to more closely relate to them?The text was updated successfully, but these errors were encountered: