Your variables seems to be identic ,use an array of 50 variables then,instead of 50 variables,compare them when you're everloading operator==,that would help you to decrease your code,
I affraid to say that there is not a way but your own one ,coz I never heard about object comparaison, object can be copied thats easy by a bitwise copying, but I can figur out how It can manage to compare with another
finaly I dont see any harm using your method ,a bunch of codes added so what
hope some expert in this website lending some insights
Just use operator == thats the only way to compare any object? Its just that you know int == int is already overloaded but Hello == Hello is not overloaded yet so you must overload it manually.