fix(plugins): Implement __eq for Channel (#6456)

This commit is contained in:
nerix
2025-09-14 13:28:39 +02:00
committed by GitHub
parent 60c3e1432a
commit c7dea40b6b
5 changed files with 37 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#pragma once
#include <memory>
namespace chatterino {
/// Check if the owner of two weak pointers is equal.
///
/// Like `std::weak_ptr::owner_before`, this compares the control blocks,
/// not the objects themselves.
/// Equivalent to the C++ 26 `std::weak_ptr::owner_equal`.
template <typename T>
bool weakOwnerEquals(const std::weak_ptr<T> &a,
const std::weak_ptr<T> &b) noexcept
{
return !a.owner_before(b) && !b.owner_before(a);
}
} // namespace chatterino