1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Ranges: Add equality operators

This commit is contained in:
attila 2025-02-03 12:30:32 +01:00 committed by Attila Szarvas
parent 2842c8ef8e
commit 6cf697bd6d

View file

@ -133,6 +133,9 @@ struct Ranges final
#endif
}
bool operator== (const Ranges& other) const { return ranges == other.ranges; }
bool operator!= (const Ranges& other) const { return ranges != other.ranges; }
auto& getRanges() { return ranges; }
auto& getRanges() const { return ranges; }
@ -564,6 +567,8 @@ class RangedValues
return j ? std::make_optional (self.getItem (*j)) : std::nullopt;
}
auto tie() const { return std::make_tuple (ranges, values); }
public:
static constexpr bool canMergeEqualItems = hasEqualityOperator<T>;
@ -573,6 +578,10 @@ public:
return RangedValuesIterator<std::remove_pointer_t<decltype (rv->values.data())>> (rv->values.data(), base, iterator);
}
//==============================================================================
bool operator== (const RangedValues& other) const { return tie() == other.tie(); }
bool operator!= (const RangedValues& other) const { return tie() != other.tie(); }
//==============================================================================
auto begin()
{