| 2808 | |
| 2809 | template<typename T> |
| 2810 | void FlatBufferBuilder::Required(Offset<T> table, voffset_t field) { |
| 2811 | auto table_ptr = reinterpret_cast<const Table *>(buf_.data_at(table.o)); |
| 2812 | bool ok = table_ptr->GetOptionalFieldOffset(field) != 0; |
| 2813 | // If this fails, the caller will show what field needs to be set. |
| 2814 | FLATBUFFERS_ASSERT(ok); |
| 2815 | (void)ok; |
| 2816 | } |
| 2817 | |
| 2818 | /// @brief This can compute the start of a FlatBuffer from a root pointer, i.e. |
| 2819 | /// it is the opposite transformation of GetRoot(). |