The return type of size() in simd and simd_mask is specified to be std::size_t. This is for consistency with all other size() functions in the STL. However:
for (simd<int> i([](int n) { return n; }); all_of(i < N); i += simd<int>::size()) doesn't compile because size_t does not implicitly convert to simd<int>
the value of size() is supposed to be small, never getting even close to the amount of addressable memory
it's simd_abi::fixed_size<int> not simd_abi::fixed_size<size_t> for most of the reasons above, so a change to int would make it consistent
The return type of
size()
insimd
andsimd_mask
is specified to bestd::size_t
. This is for consistency with all othersize()
functions in the STL. However:simd
andsimd_mask
are not containers, so this should be a non-goalfor (simd<int> i([](int n) { return n; }); all_of(i < N); i += simd<int>::size())
doesn't compile becausesize_t
does not implicitly convert tosimd<int>
size()
is supposed to be small, never getting even close to the amount of addressable memorysimd_abi::fixed_size<int>
notsimd_abi::fixed_size<size_t>
for most of the reasons above, so a change toint
would make it consistent