suppress bounds.1 (#950)

Suppress "warning C26481: Don't use pointer arithmetic. Use span instead (bounds.1)."

Co-authored-by: Werner Henze <werner.henze+gitcommits@posteo.de>
This commit is contained in:
beinhaerter 2020-11-11 22:47:58 +01:00 committed by GitHub
parent 9150ce9a95
commit 00d4a5aab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,6 +152,9 @@ namespace details
{
Expects(begin_ && current_ && end_);
Expects(current_ < end_);
// clang-format off
GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
// clang-format on
++current_;
return *this;
}
@ -183,6 +186,9 @@ namespace details
if (n != 0) Expects(begin_ && current_ && end_);
if (n > 0) Expects(end_ - current_ >= n);
if (n < 0) Expects(current_ - begin_ >= -n);
// clang-format off
GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
// clang-format on
current_ += n;
return *this;
}