suppress code analysis warning

- suppress " warning C26481: Don't use pointer arithmetic. Use span instead (bounds.1)."
- Please note that the suppression in `end()` does not work with MSVC 16.5.4.
This commit is contained in:
Werner Henze 2020-04-19 16:41:12 +02:00
parent 9f6a9a5807
commit fb1243d735

View File

@ -582,12 +582,18 @@ public:
constexpr iterator begin() const noexcept
{
const auto data = storage_.data();
// clang-format off
GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
// clang-format on
return {data, data + size(), data};
}
constexpr iterator end() const noexcept
{
const auto data = storage_.data();
// clang-format off
GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
// clang-format on
const auto endData = data + storage_.size();
return {data, endData, endData};
}