From 3ff6004bc3c2c8a2d578379ac355d600fc875a8f Mon Sep 17 00:00:00 2001 From: beinhaerter <34543625+beinhaerter@users.noreply.github.com> Date: Sun, 11 Feb 2018 21:19:10 +0100 Subject: [PATCH] added const (#605) Resolves compiler code analysis warning ...\gsl\include\gsl\string_span(101): warning C26496: The variable 'str_span' is assigned only once, mark it as const (con.4: https://go.microsoft.com/fwlink/p/?LinkID=784969). --- include/gsl/string_span | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gsl/string_span b/include/gsl/string_span index fa8b515..3c40aaa 100644 --- a/include/gsl/string_span +++ b/include/gsl/string_span @@ -98,7 +98,7 @@ namespace details { if (str == nullptr || n <= 0) return 0; - span str_span{str, n}; + const span str_span{str, n}; std::ptrdiff_t len = 0; while (len < n && str_span[len]) len++;