Skip to content

Commit 00ad02a

Browse files
IcantjuddleBen Judd
authored andcommitted
Add more operators.
1 parent 150644d commit 00ad02a

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

include/flatbuffers/vector.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,24 @@ struct VectorIterator {
5656
return data_ == other.data_;
5757
}
5858

59+
bool operator!=(const VectorIterator &other) const {
60+
return data_ != other.data_;
61+
}
62+
5963
bool operator<(const VectorIterator &other) const {
6064
return data_ < other.data_;
6165
}
6266

63-
bool operator!=(const VectorIterator &other) const {
64-
return data_ != other.data_;
67+
bool operator>(const VectorIterator &other) const {
68+
return data_ > other.data_;
69+
}
70+
71+
bool operator<=(const VectorIterator &other) const {
72+
return !(data_ > other.data_);
73+
}
74+
75+
bool operator>=(const VectorIterator &other) const {
76+
return !(data_ < other.data_);
6577
}
6678

6779
difference_type operator-(const VectorIterator &other) const {

0 commit comments

Comments
 (0)