Browse Source

Implements Vector::contains() method

The Vector::contains() method was not defined. This PR resolves that by
implementing the template method.
chaigler 9 years ago
parent
commit
35c579dbdd
1 changed files with 5 additions and 0 deletions
  1. 5 0
      engine/source/collection/vector.h

+ 5 - 0
engine/source/collection/vector.h

@@ -456,6 +456,11 @@ template<class T> inline bool Vector<T>::empty() const
    return (mElementCount == 0);
 }
 
+template<class T> inline bool Vector<T>::contains(const T& t) const
+{
+    return find_next(t) != -1;
+}
+
 template<class T> inline void Vector<T>::insert(iterator p,const T& x)
 {
    U32 index = (U32) (p - mArray);