MCPcopy Create free account
hub / github.com/fmtlib/fmt / code_point_length

Function code_point_length

include/fmt/base.h:1286–1290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1284// Returns the number of code units in a code point or 1 on error.
1285template <typename Char>
1286FMT_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.

Callers 2

parse_alignMethod · 0.85
parse_format_specsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected