diff --git a/include/flatbuffers/flatbuffer_builder.h b/include/flatbuffers/flatbuffer_builder.h index 9ceca8207b6..96e9dfae1f3 100644 --- a/include/flatbuffers/flatbuffer_builder.h +++ b/include/flatbuffers/flatbuffer_builder.h @@ -795,7 +795,7 @@ template class FlatBufferBuilderImpl { /// buffer as a `vector`. /// @return Returns a typed `Offset` into the serialized data indicating /// where the vector is stored. - template> + template, typename = std::enable_if_t>> Offset> CreateVector(const std::vector &v) { return CreateVector(data(v), v.size()); } @@ -809,7 +809,8 @@ template class FlatBufferBuilderImpl { // vector may be implemented using a bit-set, so we can't access it as // an array. Instead, read elements manually. // Background: https://isocpp.org/blog/2012/11/on-vectorbool - Offset> CreateVector(const std::vector &v) { + template, typename = std::enable_if_t>> + Offset> CreateVector(const std::vector &v) { StartVector(v.size()); for (auto i = v.size(); i > 0;) { PushElement(static_cast(v[--i]));