mdbx++: явное приведение к int внутри constexpr mdbx::memcmp().

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2024-03-23 15:32:02 +03:00
parent d0799fd373
commit 80e9667ead

View File

@ -5120,8 +5120,8 @@ static MDBX_CXX20_CONSTEXPR int memcmp(const void *a, const void *b,
__cpp_lib_is_constant_evaluated >= 201811L
if (::std::is_constant_evaluated()) {
for (size_t i = 0; i < bytes; ++i) {
const int diff =
static_cast<const byte *>(a)[i] - static_cast<const byte *>(b)[i];
const int diff = int(static_cast<const byte *>(a)[i]) -
int(static_cast<const byte *>(b)[i]);
if (diff)
return diff;
}