| 1919 | /// where the vector is stored. |
| 1920 | template<typename T> |
| 1921 | Offset<Vector<const T *>> CreateVectorOfStructs(const T *v, size_t len) { |
| 1922 | StartVector(len * sizeof(T) / AlignOf<T>(), AlignOf<T>()); |
| 1923 | if (len > 0) { |
| 1924 | PushBytes(reinterpret_cast<const uint8_t *>(v), sizeof(T) * len); |
| 1925 | } |
| 1926 | return Offset<Vector<const T *>>(EndVector(len)); |
| 1927 | } |
| 1928 | |
| 1929 | /// @brief Serialize an array of native structs into a FlatBuffer `vector`. |
| 1930 | /// @tparam T The data type of the struct array elements. |
no test coverage detected