mirror of
https://github.com/isar/libmdbx.git
synced 2024-12-28 18:58:48 +08:00
mdbx++: явное приведение к int
внутри constexpr mdbx::memcmp()
.
This commit is contained in:
parent
d0799fd373
commit
80e9667ead
4
mdbx.h++
4
mdbx.h++
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user