[ox/std] Add operator== to Vector

This commit is contained in:
Gary Talent 2021-04-15 23:34:56 -05:00
parent 2dde9473d5
commit caca376028

View File

@ -34,6 +34,8 @@ class Vector {
~Vector();
bool operator==(const Vector &other) const;
Vector &operator=(const Vector &other);
Vector &operator=(Vector &&other);
@ -132,6 +134,16 @@ Vector<T>::~Vector() {
m_items = nullptr;
}
template<typename T>
bool Vector<T>::operator==(const Vector<T> &other) const {
for (std::size_t i = 0; i < m_size; i++) {
if (!(m_items[i] == other.m_items[i])) {
return false;
}
}
return true;
}
template<typename T>
Vector<T> &Vector<T>::operator=(const Vector<T> &other) {
this->~Vector<T>();