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));