| 1284 | // Returns the number of code units in a code point or 1 on error. |
| 1285 | template <typename Char> |
| 1286 | FMT_CONSTEXPR auto code_point_length(const Char* begin) -> int { |
| 1287 | if FMT_CONSTEXPR20 (sizeof(Char) != 1) return 1; |
| 1288 | auto c = static_cast<unsigned char>(*begin); |
| 1289 | return static_cast<int>((0x3a55000000000000ull >> (2 * (c >> 3))) & 3) + 1; |
| 1290 | } |
| 1291 | |
| 1292 | // Parses the range [begin, end) as an unsigned integer. This function assumes |
| 1293 | // that the range is non-empty and the first character is a digit. |
no outgoing calls
no test coverage detected