| 1386 | } |
| 1387 | |
| 1388 | static BitWidth WidthB(size_t byte_width) { |
| 1389 | switch (byte_width) { |
| 1390 | case 1: return BIT_WIDTH_8; |
| 1391 | case 2: return BIT_WIDTH_16; |
| 1392 | case 4: return BIT_WIDTH_32; |
| 1393 | case 8: return BIT_WIDTH_64; |
| 1394 | default: FLATBUFFERS_ASSERT(false); return BIT_WIDTH_64; |
| 1395 | } |
| 1396 | } |
| 1397 | |
| 1398 | template<typename T> static Type GetScalarType() { |
| 1399 | static_assert(flatbuffers::is_scalar<T>::value, "Unrelated types"); |