I created a custom struct called FItem. Then I declared an Array in my header:
TArray>FItem MyItems; (cant write the arrows here but they are done correctly in my code)
Then in my cpp
FItem Temp;
MyItems.Find(Temp);
And I get the following compile error:
Error 2 error C2678: binary ‘==’ : no operator found which takes a left-hand operand of type ‘const FItem’ (or there is no acceptable conversion)
Any ideas why this is happening?
Where do you use == operator? you dont have in code you pasted, check the line that error is pointing to, considering it’s ==, it’s most likely “if” condition
Thank you VERY VERY VERY much! You didn’t only help me on this issue but made me realize the way to approach 2 or 3 problems I ran into earlier this week. Thanks!
Well obviously the parameters of the overwritten operator weren’t correct.
If I do it this way everything works just fine:
bool operator==( const FInventoryItemStruct& Other ) const