non member bool operator

This commit is contained in:
Robin Müller 2020-09-29 17:51:16 +02:00
parent 4eef7bfc01
commit 6c0bb23ed6

View File

@ -131,21 +131,18 @@ public:
const T *operator->() const { const T *operator->() const {
return value; return value;
} }
//SHOULDDO this should be implemented as non-member
bool operator==(const typename
ArrayList<T, count_t>::Iterator& other) const {
return (value == other.value);
}
//SHOULDDO this should be implemented as non-member
bool operator!=(const typename
ArrayList<T, count_t>::Iterator& other) const {
return !(*this == other);
}
}; };
friend bool operator==(const ArrayList::Iterator& lhs,
const ArrayList::Iterator& rhs) {
return (lhs.value == rhs.value);
}
friend bool operator!=(const ArrayList::Iterator& lhs,
const ArrayList::Iterator& rhs) {
return not (lhs.value == rhs.value);
}
/** /**
* Iterator pointing to the first stored elmement * Iterator pointing to the first stored elmement
* *
@ -251,4 +248,6 @@ protected:
bool allocated; bool allocated;
}; };
#endif /* FSFW_CONTAINER_ARRAYLIST_H_ */ #endif /* FSFW_CONTAINER_ARRAYLIST_H_ */