From 25a15950f5a24d7217689739ed8f6dac64912d62 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Tue, 20 Jun 2017 09:40:10 -0700 Subject: [PATCH] Avoiding wrong template specialization on new CreateVector Change-Id: I0da57cc71318ea13c10b547e2dfe3a2d4f32b4d9 Tested: on OS X. --- include/flatbuffers/flatbuffers.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index dfb7d62d3..9216cf4d6 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -1119,6 +1119,9 @@ class FlatBufferBuilder /// @return Returns a typed `Offset` into the serialized data indicating /// where the vector is stored. template Offset> CreateVector(const T *v, size_t len) { + // If this assert hits, you're specifying a template argument that is + // causing the wrong overload to be selected, remove it. + AssertScalarT(); StartVector(len, sizeof(T)); #if FLATBUFFERS_LITTLEENDIAN PushBytes(reinterpret_cast(v), len * sizeof(T));