mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-16 17:22:21 +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.
|
/// in the buffer.
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Offset<Vector<T>> CreateUninitializedVector(size_t len, T **buf) {
|
Offset<Vector<T>> CreateUninitializedVector(size_t len, T **buf) {
|
||||||
|
AssertScalarT<T>();
|
||||||
return CreateUninitializedVector(len, sizeof(T),
|
return CreateUninitializedVector(len, sizeof(T),
|
||||||
reinterpret_cast<uint8_t **>(buf));
|
reinterpret_cast<uint8_t **>(buf));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user