Copy data from a span with endian conversion. If this Array and the span overlap, the behavior is undefined.
| 509 | // Copy data from a span with endian conversion. |
| 510 | // If this Array and the span overlap, the behavior is undefined. |
| 511 | void CopyFromSpan(flatbuffers::span<const T, length> src) { |
| 512 | const auto p1 = reinterpret_cast<const uint8_t *>(src.data()); |
| 513 | const auto p2 = Data(); |
| 514 | FLATBUFFERS_ASSERT(!(p1 >= p2 && p1 < (p2 + length)) && |
| 515 | !(p2 >= p1 && p2 < (p1 + length))); |
| 516 | (void)p1; |
| 517 | (void)p2; |
| 518 | |
| 519 | CopyFromSpanImpl( |
| 520 | flatbuffers::integral_constant < bool, |
| 521 | !scalar_tag::value || sizeof(T) == 1 || FLATBUFFERS_LITTLEENDIAN > (), |
| 522 | src); |
| 523 | } |
| 524 | |
| 525 | protected: |
| 526 | void MutateImpl(flatbuffers::integral_constant<bool, true>, uoffset_t i, |