| 252 | // Warning: does no typechecking. |
| 253 | template<typename T> |
| 254 | T *GetAnyVectorElemPointer(const VectorOfAny *vec, size_t i) { |
| 255 | auto elem_ptr = vec->Data() + sizeof(uoffset_t) * i; |
| 256 | return reinterpret_cast<T *>(elem_ptr + ReadScalar<uoffset_t>(elem_ptr)); |
| 257 | } |
| 258 | |
| 259 | // Get the inline-address of a vector element. Useful for Structs (pass Struct |
| 260 | // as template arg), or being able to address a range of scalars in-line. |