mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 17:00:37 +00:00
AK: Add comparison operators to NonnullRefPtr
This commit is contained in:
parent
61a703816c
commit
ce7d868d6b
Notes:
sideshowbarker
2024-07-17 09:34:24 +09:00
Author: https://github.com/AllanRegush Commit: https://github.com/SerenityOS/serenity/commit/ce7d868d6b Pull-request: https://github.com/SerenityOS/serenity/pull/14330 Issue: https://github.com/SerenityOS/serenity/issues/12779 Reviewed-by: https://github.com/MacDue ✅ Reviewed-by: https://github.com/linusg
1 changed files with 6 additions and 0 deletions
|
@ -218,6 +218,12 @@ public:
|
|||
AK::swap(m_ptr, other.m_ptr);
|
||||
}
|
||||
|
||||
bool operator==(NonnullRefPtr const& other) const { return m_ptr == other.m_ptr; }
|
||||
bool operator!=(NonnullRefPtr const& other) const { return m_ptr != other.m_ptr; }
|
||||
|
||||
bool operator==(NonnullRefPtr& other) { return m_ptr == other.m_ptr; }
|
||||
bool operator!=(NonnullRefPtr& other) { return m_ptr != other.m_ptr; }
|
||||
|
||||
// clang-format off
|
||||
private:
|
||||
NonnullRefPtr() = delete;
|
||||
|
|
Loading…
Reference in a new issue