mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
SafePointer: Add new equality operators to avoid ambiguous operator warnings with clang 14
This commit is contained in:
parent
17bf5c167c
commit
a8c85f5969
1 changed files with 3 additions and 0 deletions
|
|
@ -2414,6 +2414,9 @@ public:
|
|||
/** If the component is valid, this deletes it and sets this pointer to null. */
|
||||
void deleteAndZero() { delete std::exchange (weakRef, nullptr); }
|
||||
|
||||
bool operator== (SafePointer other) const noexcept { return weakRef == other.weakRef; }
|
||||
bool operator!= (SafePointer other) const noexcept { return ! operator== (other); }
|
||||
|
||||
bool operator== (ComponentType* component) const noexcept { return weakRef == component; }
|
||||
bool operator!= (ComponentType* component) const noexcept { return weakRef != component; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue