CreateUnitializedVectorOfStructs and tests (#4781)

* CreateUnitializedVectorOfStructs and tests

* Incorporating review comments

* snake_case variable names
This commit is contained in:
Shivendra Agarwal
2018-06-18 22:42:26 +05:30
committed by Wouter van Oortmerssen
parent 7330436713
commit bb321fbe19
3 changed files with 35 additions and 0 deletions

View File

@@ -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();