C2678 Error With Tarray contain & remove functions

I’m having trouble checking if a Tarray contains the item I have and the ability to remove it.

  Array.h(2627): [C2678] binary '==': no operator found which takes a left-hand operand of type 'VirtualItem' (or there is no acceptable conversion)
  Array.h(2627): [C2678] while trying to match the argument list '(VirtualItem, const VirtualItem)'
  Array.h(2623): [C2678] while compiling class template member function 'int TArray<VirtualItem,FDefaultAllocator>::Remove(const VirtualItem &)'
  ItemCache.cpp(63): [C2678] see reference to function template instantiation 'int TArray<VirtualItem,FDefaultAllocator>::Remove(const VirtualItem &)' being compiled
  ItemCache.h(43): [C2678] see reference to class template instantiation 'TArray<VirtualItem,FDefaultAllocator>' being compiled

You need to define an == operator for the type contained by the array.

1 Like

And remove destructor definitions from VirtualItem, you don’t need it.

I did that but when I attempt to use the Tarray.remove or Tarray.Contains I get an error as well.