| 2691 | |
| 2692 | template<typename T> |
| 2693 | void FlatBufferBuilder::Required(Offset<T> table, voffset_t field) { |
| 2694 | auto table_ptr = reinterpret_cast<const Table *>(buf_.data_at(table.o)); |
| 2695 | bool ok = table_ptr->GetOptionalFieldOffset(field) != 0; |
| 2696 | // If this fails, the caller will show what field needs to be set. |
| 2697 | FLATBUFFERS_ASSERT(ok); |
| 2698 | (void)ok; |
| 2699 | } |
| 2700 | |
| 2701 | /// @brief This can compute the start of a FlatBuffer from a root pointer, i.e. |
| 2702 | /// it is the opposite transformation of GetRoot(). |