Skip to content

Commit a9ac668

Browse files
committed
Removed iterator from TypedArray.
1 parent 7b85d86 commit a9ac668

File tree

1 file changed

+0
-93
lines changed

1 file changed

+0
-93
lines changed

include/godot_cpp/variant/typed_array.hpp

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -35,90 +35,9 @@
3535

3636
namespace godot {
3737

38-
struct ConstIterator {
39-
_FORCE_INLINE_ const Variant &operator*() const { return *element_ptr; }
40-
_FORCE_INLINE_ const Variant *operator->() const { return element_ptr; }
41-
42-
_FORCE_INLINE_ ConstIterator &operator++() {
43-
element_ptr++;
44-
return *this;
45-
}
46-
_FORCE_INLINE_ ConstIterator &operator--() {
47-
element_ptr--;
48-
return *this;
49-
}
50-
51-
_FORCE_INLINE_ bool operator==(const ConstIterator &p_other) const { return element_ptr == p_other.element_ptr; }
52-
_FORCE_INLINE_ bool operator!=(const ConstIterator &p_other) const { return element_ptr != p_other.element_ptr; }
53-
54-
_FORCE_INLINE_ ConstIterator(const Variant *p_element_ptr) :
55-
element_ptr(p_element_ptr) {}
56-
_FORCE_INLINE_ ConstIterator() {}
57-
_FORCE_INLINE_ ConstIterator(const ConstIterator &p_other) :
58-
element_ptr(p_other.element_ptr) {}
59-
60-
_FORCE_INLINE_ ConstIterator &operator=(const ConstIterator &p_other) {
61-
element_ptr = p_other.element_ptr;
62-
return *this;
63-
}
64-
65-
private:
66-
const Variant *element_ptr = nullptr;
67-
};
68-
69-
struct Iterator {
70-
_FORCE_INLINE_ Variant &operator*() const { return *element_ptr; }
71-
_FORCE_INLINE_ Variant *operator->() const { return element_ptr; }
72-
73-
_FORCE_INLINE_ Iterator &operator++() {
74-
element_ptr++;
75-
return *this;
76-
}
77-
_FORCE_INLINE_ Iterator &operator--() {
78-
element_ptr--;
79-
return *this;
80-
}
81-
82-
_FORCE_INLINE_ bool operator==(const Iterator &p_other) const { return element_ptr == p_other.element_ptr; }
83-
_FORCE_INLINE_ bool operator!=(const Iterator &p_other) const { return element_ptr != p_other.element_ptr; }
84-
85-
_FORCE_INLINE_ Iterator(Variant *p_element_ptr) :
86-
element_ptr(p_element_ptr) {}
87-
_FORCE_INLINE_ Iterator() {}
88-
_FORCE_INLINE_ Iterator(const Iterator &p_other) :
89-
element_ptr(p_other.element_ptr) {}
90-
91-
_FORCE_INLINE_ Iterator &operator=(const Iterator &p_other) {
92-
element_ptr = p_other.element_ptr;
93-
return *this;
94-
}
95-
96-
operator ConstIterator() const {
97-
return ConstIterator(element_ptr);
98-
}
99-
100-
private:
101-
Variant *element_ptr = nullptr;
102-
};
103-
10438
template <typename T>
10539
class TypedArray : public Array {
10640
public:
107-
Iterator begin() {
108-
return Iterator(ptrw());
109-
}
110-
111-
Iterator end() {
112-
return Iterator(ptrw() + size());
113-
}
114-
115-
ConstIterator begin() const {
116-
return ConstIterator(ptr());
117-
}
118-
ConstIterator end() const {
119-
return ConstIterator(ptr() + size());
120-
}
121-
12241
_FORCE_INLINE_ void operator=(const Array &p_array) {
12342
ERR_FAIL_COND_MSG(!is_same_typed(p_array), "Cannot assign an array with a different element type.");
12443
_ref(p_array);
@@ -145,18 +64,6 @@ class TypedArray : public Array {
14564
template <> \
14665
class TypedArray<m_type> : public Array { \
14766
public: \
148-
Iterator begin() { \
149-
return Iterator(ptrw()); \
150-
} \
151-
Iterator end() { \
152-
return Iterator(ptrw() + size()); \
153-
} \
154-
ConstIterator begin() const { \
155-
return ConstIterator(ptr()); \
156-
} \
157-
ConstIterator end() const { \
158-
return ConstIterator(ptr() + size()); \
159-
} \
16067
_FORCE_INLINE_ void operator=(const Array &p_array) { \
16168
ERR_FAIL_COND_MSG(!is_same_typed(p_array), "Cannot assign an array with a different element type."); \
16269
_ref(p_array); \

0 commit comments

Comments
 (0)