mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Enforcing CreateUninitializedVector is only used with scalars.
This function cannot work with any offset types (since offsets must always point forward) so this avoid possible mistakes. Change-Id: I1b3dfbefc8d40da630345b9b04f9aff4a990e8e5
This commit is contained in:
@@ -1540,6 +1540,7 @@ class FlatBufferBuilder {
|
||||
/// in the buffer.
|
||||
template<typename T>
|
||||
Offset<Vector<T>> CreateUninitializedVector(size_t len, T **buf) {
|
||||
AssertScalarT<T>();
|
||||
return CreateUninitializedVector(len, sizeof(T),
|
||||
reinterpret_cast<uint8_t **>(buf));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user