diff options
author | beinhaerter <34543625+beinhaerter@users.noreply.github.com> | 2020-11-12 00:47:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-12 00:47:58 +0300 |
commit | 00d4a5aab6669258fc450d7ebfd1c37c78bc7473 (patch) | |
tree | 8c422b3232a0f0b90a6d48bd52b1b3a91ee99bdf | |
parent | 9150ce9a95680268b16c4fcf3e727ae76ecb9bac (diff) |
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>
-rw-r--r-- | include/gsl/span | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/gsl/span b/include/gsl/span index 0f567df..506eb4c 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -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; } |