try to apply std everywhere is possible.

This commit is contained in:
HedgehogInTheCPP 2026-08-18 18:35:13 +03:00
parent fe15d1a0a8
commit 2aa1746bb9
2 changed files with 6 additions and 6 deletions

View File

@ -172,7 +172,7 @@ skip_zeros(UC const *&first, UC const *last) noexcept {
if (!is_constant_evaluated()) {
while (std::distance(first, last) >= int_cmp_len<UC>()) {
uint64_t val;
::memcpy(&val, first, sizeof(uint64_t));
std::memcpy(&val, first, sizeof(uint64_t));
if (val != int_cmp_zeros<UC>()) {
break;
}
@ -196,7 +196,7 @@ is_truncated(UC const *first, UC const *last) noexcept {
if (!is_constant_evaluated()) {
while (std::distance(first, last) >= int_cmp_len<UC>()) {
uint64_t val;
::memcpy(&val, first, sizeof(uint64_t));
std::memcpy(&val, first, sizeof(uint64_t));
if (val != int_cmp_zeros<UC>()) {
return true;
}

View File

@ -384,14 +384,14 @@ fastfloat_strncasecmp3(UC const *actual_mixedcase,
mask = 0x0000002000000020;
}
if FASTFLOAT_CONSTEXPR17 (sizeof(UC) == 1 || sizeof(UC) == 2) {
::memcpy(&val1, actual_mixedcase, 3 * sizeof(UC));
::memcpy(&val2, expected_lowercase, 3 * sizeof(UC));
std::memcpy(&val1, actual_mixedcase, 3 * sizeof(UC));
std::memcpy(&val2, expected_lowercase, 3 * sizeof(UC));
val1 |= mask;
val2 |= mask;
return val1 == val2;
} else if FASTFLOAT_CONSTEXPR17 (sizeof(UC) == 4) {
::memcpy(&val1, actual_mixedcase, 2 * sizeof(UC));
::memcpy(&val2, expected_lowercase, 2 * sizeof(UC));
std::memcpy(&val1, actual_mixedcase, 2 * sizeof(UC));
std::memcpy(&val2, expected_lowercase, 2 * sizeof(UC));
val1 |= mask;
if (val1 != val2) {
return false;