Commit 829fc55c authored by Chris Palmer's avatar Chris Palmer Committed by Commit Bot

Add `operator<=` to checked iterators.

Bug: 817982
Change-Id: Ice97de84ed3e45ea4c237e953a80a5817c5d53b4
Reviewed-on: https://chromium-review.googlesource.com/c/1372893
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629100}
parent 63183060
...@@ -57,6 +57,11 @@ class CheckedRandomAccessIterator { ...@@ -57,6 +57,11 @@ class CheckedRandomAccessIterator {
return current_ < other.current_; return current_ < other.current_;
} }
bool operator<=(const CheckedRandomAccessIterator& other) const {
CheckComparable(other);
return current_ <= other.current_;
}
CheckedRandomAccessIterator& operator++() { CheckedRandomAccessIterator& operator++() {
CHECK(current_ != end_); CHECK(current_ != end_);
++current_; ++current_;
...@@ -205,6 +210,11 @@ class CheckedRandomAccessConstIterator { ...@@ -205,6 +210,11 @@ class CheckedRandomAccessConstIterator {
return current_ < other.current_; return current_ < other.current_;
} }
bool operator<=(const CheckedRandomAccessConstIterator& other) const {
CheckComparable(other);
return current_ <= other.current_;
}
CheckedRandomAccessConstIterator& operator++() { CheckedRandomAccessConstIterator& operator++() {
CHECK(current_ != end_); CHECK(current_ != end_);
++current_; ++current_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment