From 66ca39d9c825b317f310b632f5c7d11333d6dcf6 Mon Sep 17 00:00:00 2001 From: Werner Henze <34543625+beinhaerter@users.noreply.github.com> Date: Wed, 27 May 2026 19:15:07 +0200 Subject: [PATCH] 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 --- 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 8b2c2c9..c38b5b1 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