- Add Contains() method to TArray class, returning a true/false bool as appropriate.

This commit is contained in:
Mitchell Richters 2021-08-21 13:34:58 +10:00
parent 968708a649
commit 20ea0acbec

View file

@ -292,6 +292,17 @@ public:
return i;
}
bool Contains(const T& item) const
{
unsigned int i;
for(i = 0;i < Count;++i)
{
if(Array[i] == item)
return true;
}
return false;
}
template<class Func>
unsigned int FindEx(Func compare) const
{