narrow_cast instead of static_cast (#1250)

This removes the "warning C26472: Don't use a static_cast for arithmetic conversions. Use brace initialization, gsl::narrow_cast or gsl::narrow (type.1)." issued by VS2026.

Co-authored-by: Werner Henze <w.henze@avm.de>
This commit is contained in:
Werner HenzeandWerner Henze authored and GitHub committed 2026-05-27 11:15:07 -06:00
1 parent 0249144ad1
commit 66ca39d9c8
1 file changed
+1 -1
+1 -1
View File
@@ -149,7 +149,7 @@ constexpr ElementType& at(span<ElementType, Extent> s, index i)
template <class ElementType, std::size_t Extent>
constexpr std::ptrdiff_t ssize(const span<ElementType, Extent>& s) noexcept
{
return static_cast<std::ptrdiff_t>(s.size());
return gsl::narrow_cast<std::ptrdiff_t>(s.size());
}
// [span.iter] Free functions for begin/end functions