Avoiding wrong template specialization on new CreateVector

Change-Id: I0da57cc71318ea13c10b547e2dfe3a2d4f32b4d9
Tested: on OS X.
This commit is contained in:
Wouter van Oortmerssen
2017-06-20 09:40:10 -07:00
parent 6f94fb51b1
commit 25a15950f5

View File

@@ -1119,6 +1119,9 @@ class FlatBufferBuilder
/// @return Returns a typed `Offset` into the serialized data indicating
/// where the vector is stored.
template<typename T> Offset<Vector<T>> 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<T>();
StartVector(len, sizeof(T));
#if FLATBUFFERS_LITTLEENDIAN
PushBytes(reinterpret_cast<const uint8_t *>(v), len * sizeof(T));