1
0
Fork 0
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:
reuk 2025-04-14 13:05:28 +01:00
parent 17bf5c167c
commit a8c85f5969
No known key found for this signature in database

View file

@ -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; }