mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 06:40:05 +00:00
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: 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()));
|
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:
|
private:
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue