From 39e115fdb468d614accc09d177f1b46900473481 Mon Sep 17 00:00:00 2001 From: brian-brt Date: Fri, 8 Jan 2021 11:35:55 -0800 Subject: [PATCH] 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 --- include/flatbuffers/flatbuffers.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index c429cc436..300ab6fb0 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());