From e470117e7e565669e25f39c3456bf452c6693d1d Mon Sep 17 00:00:00 2001 From: Werner Henze Date: Wed, 27 May 2026 17:25:11 +0200 Subject: [PATCH] narrow_cast instead of static_cast 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. --- include/gsl/span_ext | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gsl/span_ext b/include/gsl/span_ext index 8b2c2c948..c38b5b14b 100644 --- a/include/gsl/span_ext +++ b/include/gsl/span_ext @@ -149,7 +149,7 @@ constexpr ElementType& at(span s, index i) template constexpr std::ptrdiff_t ssize(const span& s) noexcept { - return static_cast(s.size()); + return gsl::narrow_cast(s.size()); } // [span.iter] Free functions for begin/end functions