| 575 | } |
| 576 | |
| 577 | void CopyFromSpanImpl(flatbuffers::true_type, |
| 578 | flatbuffers::span<const T, length> src) { |
| 579 | // Use std::memcpy() instead of std::copy() to avoid preformance degradation |
| 580 | // due to aliasing if T is char or unsigned char. |
| 581 | // The size is known at compile time, so memcpy would be inlined. |
| 582 | std::memcpy(data(), src.data(), length * sizeof(T)); |
| 583 | } |
| 584 | |
| 585 | // Copy data from flatbuffers::span with endian conversion. |
| 586 | void CopyFromSpanImpl(flatbuffers::false_type, |