update index_type to size_type, fix a couple Expects

This commit is contained in:
Jordan Maples [MSFT] committed 2020-02-04 15:31:33 -08:00
1 parent 61c6ef8d42
commit 5a1e4f3953
3 files changed
+17 -15

No files matched your search

+6 -4
View File
@@ -143,14 +143,14 @@ namespace details
constexpr reference operator*() const noexcept
{
Expects(begin_ && current_ && end_);
Expects(current_ < end_);
Expects(begin_ <= current_ && current_ < end_);
return *current_;
}
constexpr pointer operator->() const noexcept
{
Expects(begin_ && current_ && end_);
Expects(current_ < end_);
Expects(begin_ <= current_ && current_ < end_);
return current_;
}
constexpr span_iterator& operator++() noexcept
@@ -171,7 +171,7 @@ namespace details
constexpr span_iterator& operator--() noexcept
{
Expects(begin_ && current_ && end_);
Expects(current_ > begin_);
Expects(begin_ < current_);
--current_;
return *this;
}
@@ -295,7 +295,9 @@ namespace details
constexpr void _Verify_offset(const difference_type n) const noexcept
{ // test that *this + n is within the range of this call
Expects( n <= (current_ - begin_) && n <= (end_ - current_));
if (n != 0) Expects(begin_ && current_ && end_);
if (n > 0) Expects(end_ - current_ >= n);
if (n < 0) Expects(current_ - begin_ >= -n);
}
GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute