From 30ae5f189c7187f1e7ba418a505e0ebd936977ab Mon Sep 17 00:00:00 2001 From: Ben J Date: Tue, 28 May 2024 21:07:34 -0400 Subject: [PATCH] Add more operators. (#8309) Co-authored-by: Derek Bailey --- include/flatbuffers/vector.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/flatbuffers/vector.h b/include/flatbuffers/vector.h index ae52b9382..cd4858bb8 100644 --- a/include/flatbuffers/vector.h +++ b/include/flatbuffers/vector.h @@ -56,12 +56,24 @@ struct VectorIterator { return data_ == other.data_; } + bool operator!=(const VectorIterator &other) const { + return data_ != other.data_; + } + bool operator<(const VectorIterator &other) const { return data_ < other.data_; } - bool operator!=(const VectorIterator &other) const { - return data_ != other.data_; + bool operator>(const VectorIterator &other) const { + return data_ > other.data_; + } + + bool operator<=(const VectorIterator &other) const { + return !(data_ > other.data_); + } + + bool operator>=(const VectorIterator &other) const { + return !(data_ < other.data_); } difference_type operator-(const VectorIterator &other) const {