Game Development Community

[Solution] Vector<T>::contains() not implemented

by William Lee Sims · in Torque 2D Professional · 11/14/2013 (10:24 pm) · 1 replies

Fortunately this is a templatized function and isn't needed by the compiler until it's needed by the user.

I've implemented it in vector.h as follows:
template<class T> inline bool Vector<T>::contains(const T& t) const
{
  return find_next( t ) != -1;
}

I'll try to get this into the git dev baseline as soon as I can.

#1
11/15/2013 (3:23 am)
If you need help creating a pull request: This was written for T3D but it should be the same for Torque2D (just substitute 3 with 2 I guess).