Browse Source

Added missing ValueTree::Iterator::operator==

tags/2021-05-28
jules 7 years ago
parent
commit
4d753ed9e4
2 changed files with 8 additions and 9 deletions
  1. +4
    -6
      modules/juce_data_structures/values/juce_ValueTree.cpp
  2. +4
    -3
      modules/juce_data_structures/values/juce_ValueTree.h

+ 4
- 6
modules/juce_data_structures/values/juce_ValueTree.cpp View File

@@ -863,21 +863,19 @@ ValueTree ValueTree::getChild (int index) const
return {};
}
ValueTree::Iterator::Iterator (const ValueTree& v, bool isEnd) noexcept
ValueTree::Iterator::Iterator (const ValueTree& v, bool isEnd)
: internal (v.object != nullptr ? (isEnd ? v.object->children.end() : v.object->children.begin()) : nullptr)
{
}
ValueTree::Iterator& ValueTree::Iterator::operator++() noexcept
ValueTree::Iterator& ValueTree::Iterator::operator++()
{
internal = static_cast<SharedObject**> (internal) + 1;
return *this;
}
bool ValueTree::Iterator::operator!= (const Iterator& other) const noexcept
{
return internal != other.internal;
}
bool ValueTree::Iterator::operator== (const Iterator& other) const { return internal == other.internal; }
bool ValueTree::Iterator::operator!= (const Iterator& other) const { return internal != other.internal; }
ValueTree ValueTree::Iterator::operator*() const
{


+ 4
- 3
modules/juce_data_structures/values/juce_ValueTree.h View File

@@ -400,10 +400,11 @@ public:
*/
struct Iterator
{
Iterator (const ValueTree&, bool isEnd) noexcept;
Iterator& operator++() noexcept;
Iterator (const ValueTree&, bool isEnd);
Iterator& operator++();
bool operator!= (const Iterator&) const noexcept;
bool operator== (const Iterator&) const;
bool operator!= (const Iterator&) const;
ValueTree operator*() const;
using difference_type = std::ptrdiff_t;


Loading…
Cancel
Save