I have a C++ class I am using quite extensively that inherits from nothing (chose none in the GUI). This class is just a data class and will not be placed in the world at any point. At some point I placed this class in a TArray and attempted to use TArray::RemoveSingle. This led to the following error:
Error C2678 binary ‘==’: no operator found which takes a left-hand operand of type ‘const Quad’ (or there is no acceptable conversion) Array.h 992
I assumed this means “You don’t have a == operator. How do I find something?” So I overloaded operator== and I was right. But this got me thinking, there are probably other scenarios that my class is missing that I am not thinking of. Do I need a < operator for sorting? Do I need a toString? Since my class doesn’t inherit from anything, I do not have virtual functions to override. How can I know what functions I should make to ensure future classes behave as expected and don’t throw unexpected compiler errors?