From: brian-brt Date: Fri, 8 Jan 2021 19:35:55 +0000 (-0800) Subject: Define Vector::value_type for STL compatibility (#6394) X-Git-Tag: v2.0.0~112 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=39e115fdb468d614accc09d177f1b46900473481;p=platform%2Fupstream%2Fflatbuffers.git 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 --- diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index c429cc4..300ab6f 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -257,6 +257,7 @@ template class Vector { typedef typename IndirectHelper::return_type return_type; typedef typename IndirectHelper::mutable_return_type mutable_return_type; + typedef return_type value_type; return_type Get(uoffset_t i) const { FLATBUFFERS_ASSERT(i < size());