From afa2f3fd9a6604d7719a8492c8a2f172d5e5f1b4 Mon Sep 17 00:00:00 2001 From: Jordan Maples Date: Tue, 21 Apr 2020 16:14:58 -0700 Subject: [PATCH 1/2] fully qualify ptrdiff_t in multi_span and remove it from gsl\gsl --- include/gsl/gsl | 1 - include/gsl/multi_span | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/gsl/gsl b/include/gsl/gsl index 55862eb..3c2f574 100644 --- a/include/gsl/gsl +++ b/include/gsl/gsl @@ -21,7 +21,6 @@ #include // Ensures/Expects #include // byte #include // finally()/narrow()/narrow_cast()... -#include // multi_span, strided_span... #include // owner, not_null #include // span #include // zstring, string_span, zstring_builder... diff --git a/include/gsl/multi_span b/include/gsl/multi_span index 779f6e9..ce05a8b 100644 --- a/include/gsl/multi_span +++ b/include/gsl/multi_span @@ -23,7 +23,7 @@ #include // for transform, lexicographical_compare #include // for array -#include // for ptrdiff_t, size_t, nullptr_t +#include // for std::ptrdiff_t, size_t, nullptr_t #include // for PTRDIFF_MAX #include // for divides, multiplies, minus, negate, plus #include // for initializer_list @@ -62,7 +62,7 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif -// GCC 7 does not like the signed unsigned missmatch (size_t ptrdiff_t) +// GCC 7 does not like the signed unsigned missmatch (size_t std::ptrdiff_t) // While there is a conversion from signed to unsigned, it happens at // compiletime, so the compiler wouldn't have to warn indiscriminently, but // could check if the source value actually doesn't fit into the target type @@ -392,9 +392,9 @@ namespace details template constexpr size_type contains(const T& arr) const { - const ptrdiff_t last = this->Base::template contains(arr); + const std::ptrdiff_t last = this->Base::template contains(arr); if (last == -1) return -1; - const ptrdiff_t cur = this->Base::totalSize() * arr[Dim]; + const std::ptrdiff_t cur = this->Base::totalSize() * arr[Dim]; return cur < m_bound ? cur + last : -1; } @@ -462,7 +462,7 @@ namespace details GSL_SUPPRESS(bounds.4) // NO-FORMAT: attribute Expects(arr[Dim] >= 0 && arr[Dim] < CurrentRange); // Index is out of range GSL_SUPPRESS(bounds.4) // NO-FORMAT: attribute - const ptrdiff_t d = arr[Dim]; + const std::ptrdiff_t d = arr[Dim]; return this->Base::totalSize() * d + this->Base::template linearize(arr); } From 70e1317ab66c1f8455f9d2292f29fc46973fa04d Mon Sep 17 00:00:00 2001 From: "Jordan Maples [MSFT]" <49793787+JordanMaples@users.noreply.github.com> Date: Wed, 22 Apr 2020 15:27:00 -0700 Subject: [PATCH 2/2] Update include/gsl/gsl --- include/gsl/gsl | 1 + 1 file changed, 1 insertion(+) diff --git a/include/gsl/gsl b/include/gsl/gsl index 3c2f574..55862eb 100644 --- a/include/gsl/gsl +++ b/include/gsl/gsl @@ -21,6 +21,7 @@ #include // Ensures/Expects #include // byte #include // finally()/narrow()/narrow_cast()... +#include // multi_span, strided_span... #include // owner, not_null #include // span #include // zstring, string_span, zstring_builder...