Hewill Kang [Tuesday, 14 April 2026, 16:27:53 CEST]: > LGTM. > But your __static_sized_range already blocks integer-class types, so this > doesn't make any real difference, does it?
It turns an implicit size_t -> int conversion into an explicit conversion. Still, even with -Wconversion -Wsign-conversion -Wsystem-headers, I don't think could ever have been an issue. It simply makes the code match the spec more closely -> less mental load when reviewing the code against the standard. Also, __static_sized_range wasn't a conscious choice. integer-class types simply aren't part of my mental model (yet) and I've yet to get practical experience ... - Matthias > > Matthias Kretz <[email protected]> 於 2026年4月14日週二 下午9:02寫道: > > > > From: Matthias Kretz <[email protected]> > > > > > > > > libstdc++-v3/ChangeLog: > > > > > > > > * include/bits/simd_vec.h (basic_vec deduction guide): Explicit > > cast to simd-size-type from range size type. > > > > > > > > Signed-off-by: Matthias Kretz <[email protected]> > > --- > > > > libstdc++-v3/include/bits/simd_vec.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/libstdc++-v3/include/bits/simd_vec.h > > b/libstdc++-v3/include/bits/ > > simd_vec.h > > index da194824e72..2574bf7c3ad 100644 > > --- a/libstdc++-v3/include/bits/simd_vec.h > > +++ b/libstdc++-v3/include/bits/simd_vec.h > > @@ -2264,9 +2264,9 @@ basic_vec(_Rg&& __range, flags<_Flags...> __flags = > > {}) > > > > -> basic_vec<ranges::range_value_t<_Rg>, > > > > __deduce_abi_t<ranges::range_value_t<_Rg>, > > > > #if 0 // PR117849 > > > > - ranges::size(__r)>>; > > + > > static_cast<__simd_size_type>(ranges::size(__r))>>; > > > > #else > > > > - decltype(std::span(__r))::extent>>; > > + > > static_cast<__simd_size_type>(decltype(std::span(__r))::extent)>>; > > > > #endif > > > > > > > > template <size_t _Bytes, typename _Ap> > > > > -- > > ────────────────────────────────────────────────────────────────────────── > > > > > > Dr. Matthias Kretz https://mattkretz.github.io > > GSI Helmholtz Center for Heavy Ion Research https://gsi.de > > std::simd > > > > ────────────────────────────────────────────────────────────────────────── > > > > > > > > -- ────────────────────────────────────────────────────────────────────────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Center for Heavy Ion Research https://gsi.de std::simd ──────────────────────────────────────────────────────────────────────────
