Skip to content

Commit

Permalink
Avoiding wrong template specialization on new CreateVector
Browse files Browse the repository at this point in the history
Change-Id: I0da57cc71318ea13c10b547e2dfe3a2d4f32b4d9
Tested: on OS X.
  • Loading branch information
aardappel committed Jun 20, 2017
1 parent 6f94fb5 commit 25a1595
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/flatbuffers/flatbuffers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 25a1595

Please sign in to comment.