fix failing test

This commit is contained in:
Carson Radtke 2024-11-11 14:15:19 -06:00
parent b8bfc194cf
commit 63f905878e

View File

@ -141,7 +141,6 @@ namespace details
constexpr span_iterator(pointer begin, pointer end, pointer current) constexpr span_iterator(pointer begin, pointer end, pointer current)
: begin_(begin), end_(end), current_(current) : begin_(begin), end_(end), current_(current)
{ {
Expects(begin_ && current_ && end_);
Expects(begin_ <= current_ && current <= end_); Expects(begin_ <= current_ && current <= end_);
} }
@ -194,6 +193,7 @@ namespace details
constexpr span_iterator& operator+=(const difference_type n) noexcept constexpr span_iterator& operator+=(const difference_type n) noexcept
{ {
if (n != 0) 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); if (n < 0) Expects(current_ - begin_ >= -n);
// clang-format off // clang-format off
@ -218,6 +218,7 @@ namespace details
constexpr span_iterator& operator-=(const difference_type n) noexcept constexpr span_iterator& operator-=(const difference_type n) noexcept
{ {
if (n != 0) Expects(begin_ && current_ && end_);
if (n > 0) Expects(current_ - begin_ >= n); if (n > 0) Expects(current_ - begin_ >= n);
if (n < 0) Expects(end_ - current_ >= -n); if (n < 0) Expects(end_ - current_ >= -n);
GSL_SUPPRESS(bounds .1) GSL_SUPPRESS(bounds .1)