AK: Add comparison operators to NonnullOwnPtr
This commit is contained in:
parent
709f0a2ab3
commit
50c88e5e3a
Notes:
sideshowbarker
2024-07-17 10:06:12 +09:00
Author: https://github.com/AllanRegush 🔰 Commit: https://github.com/SerenityOS/serenity/commit/50c88e5e3a Pull-request: https://github.com/SerenityOS/serenity/pull/14318 Issue: https://github.com/SerenityOS/serenity/issues/12779
1 changed files with 6 additions and 0 deletions
|
@ -135,6 +135,12 @@ public:
|
|||
return NonnullOwnPtr<U>(NonnullOwnPtr<U>::Adopt, static_cast<U&>(*leak_ptr()));
|
||||
}
|
||||
|
||||
bool operator==(NonnullOwnPtr const& other) const { return m_ptr == other.m_ptr; }
|
||||
bool operator!=(NonnullOwnPtr const& other) const { return m_ptr != other.m_ptr; }
|
||||
|
||||
bool operator==(NonnullOwnPtr& other) { return m_ptr == other.m_ptr; }
|
||||
bool operator!=(NonnullOwnPtr& other) { return m_ptr != other.m_ptr; }
|
||||
|
||||
private:
|
||||
void clear()
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue