Skip to content

Commit

Permalink
Correct MemManagerProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
morzhovets committed Nov 1, 2024
1 parent 421d4b4 commit 6febdbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/momo/MemManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,14 @@ namespace internal

static bool IsEqual(const MemManager& memManager1, const MemManager& memManager2) noexcept
{
if (&memManager1 == &memManager2)
if (&memManager1 == &memManager2 || std::is_empty<MemManager>::value)
return true;
return pvIsEqual(memManager1, memManager2, HasIsEqual<MemManager>());
}

static void Assign(MemManager&& srcMemManager, MemManager& dstMemManager) noexcept
{
if (IsEqual(srcMemManager, dstMemManager))
if (&srcMemManager == &dstMemManager || std::is_empty<MemManager>::value)
return;
pvAssign(std::move(srcMemManager), dstMemManager,
std::is_nothrow_move_assignable<MemManager>());
Expand Down Expand Up @@ -490,7 +490,7 @@ namespace internal
static bool pvIsEqual(const MemManager& /*memManager1*/, const MemManager& /*memManager2*/,
std::false_type /*hasIsEqual*/) noexcept
{
return std::is_empty<MemManager>::value;
return false;
}

static void pvAssign(MemManager&& srcMemManager, MemManager& dstMemManager,
Expand Down

0 comments on commit 6febdbc

Please sign in to comment.