| 1396 | } |
| 1397 | |
| 1398 | static BitWidth WidthB(size_t byte_width) { |
| 1399 | switch (byte_width) { |
| 1400 | case 1: return BIT_WIDTH_8; |
| 1401 | case 2: return BIT_WIDTH_16; |
| 1402 | case 4: return BIT_WIDTH_32; |
| 1403 | case 8: return BIT_WIDTH_64; |
| 1404 | default: FLATBUFFERS_ASSERT(false); return BIT_WIDTH_64; |
| 1405 | } |
| 1406 | } |
| 1407 | |
| 1408 | template<typename T> static Type GetScalarType() { |
| 1409 | static_assert(flatbuffers::is_scalar<T>::value, "Unrelated types"); |