From f4ee6ee73b99ca8586e25c56ed627320144dd55f Mon Sep 17 00:00:00 2001 From: "Jordan Maples [MSFT]" <49793787+JordanMaples@users.noreply.github.com> Date: Mon, 3 Feb 2020 17:51:25 -0800 Subject: [PATCH 1/3] Update include/gsl/span Co-Authored-By: Casey Carter --- include/gsl/span | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gsl/span b/include/gsl/span index 5f66c6c..4966961 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -294,7 +294,7 @@ namespace details } constexpr void _Verify_offset(const difference_type n) const noexcept - { // test that the iterator *this + n is a valid range in an STL + { // test that *this + n is within the span of this iterator STL // algorithm call Expects((current_ + n) >= begin_ && (current_ + n) <= end_); } From 24646c6f7cef01c817ae3af666efe54c362d5b51 Mon Sep 17 00:00:00 2001 From: "Jordan Maples [MSFT]" <49793787+JordanMaples@users.noreply.github.com> Date: Mon, 3 Feb 2020 17:51:45 -0800 Subject: [PATCH 2/3] Update include/gsl/span Co-Authored-By: Casey Carter --- include/gsl/span | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gsl/span b/include/gsl/span index 4966961..5900da5 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -128,7 +128,7 @@ namespace details public: using iterator_category = std::random_access_iterator_tag; using value_type = std::remove_cv_t; - using difference_type = ptrdiff_t; + using difference_type = std::ptrdiff_t; using pointer = std::add_pointer_t; using reference = std::add_lvalue_reference_t; From 827fafd32c9da89bd521bac9c91a0d6e37be2f1d Mon Sep 17 00:00:00 2001 From: "Jordan Maples [MSFT]" <49793787+JordanMaples@users.noreply.github.com> Date: Mon, 3 Feb 2020 18:12:32 -0800 Subject: [PATCH 3/3] Update include/gsl/span Co-Authored-By: Casey Carter --- include/gsl/span | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gsl/span b/include/gsl/span index 5900da5..c480f18 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -182,7 +182,7 @@ namespace details { Expects(begin_ && current_ && end_); if (n > 0) Expects(end_ - current_ >= n); - if (n < 0) Expects(end_ - current_ >= -n); + if (n < 0) Expects(current_ - begin_ >= -n); current_ += n; return *this; }