31 using char_type = char;
33 [[nodiscard]]
constexpr std::endian guess_endian(
void const *ptr,
size_t size, std::endian endian)
const noexcept
35 return std::endian::native;
38 template<
typename It,
typename EndIt>
43 auto const c = char_cast<char32_t>(*it++);
47 return {0xfffd,
false};
53 hi_axiom(code_point < 0x11'0000);
54 hi_axiom(not(code_point >= 0xd800 and code_point < 0xe000));
56 if (code_point < 0x80) {
57 return {uint8_t{1},
true};
60 return {uint8_t{1},
false};
65 constexpr void write(
char32_t code_point, It& dst)
const noexcept
67 hi_axiom(code_point < 0x11'0000);
68 hi_axiom(not(code_point >= 0xd800 and code_point < 0xe000));
70 if (code_point < 0x80) {
71 *dst++ = char_cast<char>(code_point);
78#if defined(HI_HAS_SSE2)
80 hi_force_inline __m128i read_ascii_chunk16(It it)
const noexcept
82 return _mm_loadu_si128(
reinterpret_cast<__m128i
const *
>(
std::addressof(*it)));
86 hi_force_inline
void write_ascii_chunk16(__m128i chunk, It dst)
const noexcept
88 _mm_storeu_si128(
reinterpret_cast<__m128i *
>(
std::addressof(*dst)), chunk);