mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-05 13:08:58 +00:00
CreateUnitializedVectorOfStructs and tests (#4781)
* CreateUnitializedVectorOfStructs and tests * Incorporating review comments * snake_case variable names
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
7330436713
commit
bb321fbe19
@@ -1545,6 +1545,12 @@ class FlatBufferBuilder {
|
||||
reinterpret_cast<uint8_t **>(buf));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Offset<Vector<const T*>> CreateUninitializedVectorOfStructs(size_t len, T **buf) {
|
||||
return CreateUninitializedVector(len, sizeof(T),
|
||||
reinterpret_cast<uint8_t **>(buf));
|
||||
}
|
||||
|
||||
/// @brief Write a struct by itself, typically to be part of a union.
|
||||
template<typename T> Offset<const T *> CreateStruct(const T &structobj) {
|
||||
NotNested();
|
||||
|
||||
Reference in New Issue
Block a user