diff options
author | brian-brt <brian.silverman@bluerivert.com> | 2021-01-08 11:35:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 11:35:55 -0800 |
commit | 39e115fdb468d614accc09d177f1b46900473481 (patch) | |
tree | f9ef4163071dac07b84f4721a790d384fe1b9b2b | |
parent | 85719669cb90e8f6a614ea8dd744efb93855bfa2 (diff) | |
download | flatbuffers-39e115fdb468d614accc09d177f1b46900473481.tar.gz flatbuffers-39e115fdb468d614accc09d177f1b46900473481.tar.bz2 flatbuffers-39e115fdb468d614accc09d177f1b46900473481.zip |
Define Vector::value_type for STL compatibility (#6394)
Specifically, this lets the googlemock container matchers work with a
flatbuffers::Vector.
https://github.com/google/googletest/blob/master/googlemock/docs/cheat_sheet.md#container-matchers
-rw-r--r-- | include/flatbuffers/flatbuffers.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index c429cc43..300ab6fb 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -257,6 +257,7 @@ template<typename T> class Vector { typedef typename IndirectHelper<T>::return_type return_type; typedef typename IndirectHelper<T>::mutable_return_type mutable_return_type; + typedef return_type value_type; return_type Get(uoffset_t i) const { FLATBUFFERS_ASSERT(i < size()); |