From 1fc12e0e5b7782d584381ae74f2ec7bc520fb82a Mon Sep 17 00:00:00 2001 From: schoetbi Date: Thu, 13 Apr 2017 01:37:22 +0200 Subject: [PATCH] C++ fixed compile error C2678 with msvc when using std::find_if on vectors (#4262) In Debug mode it is checked that iterator begin is less than end therefore the operator< in class VectorIterator is needed --- include/flatbuffers/flatbuffers.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 9fc2236b3..664be4ca4 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -296,6 +296,10 @@ public: return data_ == other.data_; } + bool operator<(const VectorIterator &other) const { + return data_ < other.data_; + } + bool operator!=(const VectorIterator &other) const { return data_ != other.data_; }