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:
parent
2842c8ef8e
commit
6cf697bd6d
1 changed files with 9 additions and 0 deletions
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue