diff --git a/BAN/include/BAN/Vector.h b/BAN/include/BAN/Vector.h index 6c7d47d93..8d0300325 100644 --- a/BAN/include/BAN/Vector.h +++ b/BAN/include/BAN/Vector.h @@ -28,6 +28,8 @@ namespace BAN void PopBack(); void Remove(size_type); + bool Has(const T&) const; + const T& operator[](size_type) const; T& operator[](size_type); @@ -105,6 +107,15 @@ namespace BAN memmove(m_data + index, m_data + index + 1, (m_size - index - 1) * sizeof(T)); m_size--; } + + template + bool Vector::Has(const T& other) const + { + for (size_type i = 0; i < m_size; i++) + if (m_data[i] == other) + return true; + return false; + } template const T& Vector::operator[](size_type index) const