mirror of https://github.com/godotengine/godot
RBMap: Add explicit copy operators to iterators
Absence thereof is deprecated and breaks builds on most compilers. Bonus: Fix parameter naming style throughout.
This commit is contained in:
parent
fec76d0c22
commit
1a1c06dfeb
|
|
@ -111,11 +111,16 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
_FORCE_INLINE_ bool operator==(const Iterator &b) const { return E == b.E; }
|
_FORCE_INLINE_ bool operator==(const Iterator &p_it) const { return E == p_it.E; }
|
||||||
_FORCE_INLINE_ bool operator!=(const Iterator &b) const { return E != b.E; }
|
_FORCE_INLINE_ bool operator!=(const Iterator &p_it) const { return E != p_it.E; }
|
||||||
explicit operator bool() const {
|
explicit operator bool() const {
|
||||||
return E != nullptr;
|
return E != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Iterator &operator=(const Iterator &p_it) {
|
||||||
|
E = p_it.E;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
Iterator(Element *p_E) { E = p_E; }
|
Iterator(Element *p_E) { E = p_E; }
|
||||||
Iterator() {}
|
Iterator() {}
|
||||||
Iterator(const Iterator &p_it) { E = p_it.E; }
|
Iterator(const Iterator &p_it) { E = p_it.E; }
|
||||||
|
|
@ -138,11 +143,16 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
_FORCE_INLINE_ bool operator==(const ConstIterator &b) const { return E == b.E; }
|
_FORCE_INLINE_ bool operator==(const ConstIterator &p_it) const { return E == p_it.E; }
|
||||||
_FORCE_INLINE_ bool operator!=(const ConstIterator &b) const { return E != b.E; }
|
_FORCE_INLINE_ bool operator!=(const ConstIterator &p_it) const { return E != p_it.E; }
|
||||||
explicit operator bool() const {
|
explicit operator bool() const {
|
||||||
return E != nullptr;
|
return E != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConstIterator &operator=(const ConstIterator &p_it) {
|
||||||
|
E = p_it.E;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
ConstIterator(const Element *p_E) { E = p_E; }
|
ConstIterator(const Element *p_E) { E = p_E; }
|
||||||
ConstIterator() {}
|
ConstIterator() {}
|
||||||
ConstIterator(const ConstIterator &p_it) { E = p_it.E; }
|
ConstIterator(const ConstIterator &p_it) { E = p_it.E; }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue