[base] Introduce base::CheckedContiguousRange
This change introduces base::CheckedContiguousRange, which similarly to base::span is a light-weight wrapper around a contiguous container performing bound CHECKs. However, in contrast to base::span this class keeps a pointer to the underlying container, and thus is able to respond to changes to data() and size(), which base::span can't do. Furthermore, this change provides a constexpr overload of base::data() for std::array and fixes a bug in CheckedContiguousIterator::operator-=. Bug: 990059 Change-Id: I3fef91c7ef7874bf495ac2ab6dbaf3a8b02dab35 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893858 Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org> Reviewed-by:Chris Palmer <palmer@chromium.org> Reviewed-by:
Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/master@{#712120}
Showing
Please register or sign in to comment