Possible to auto-compare ustructs without equality operator?

Hi!

You could just define a free == operator, no need to change engine code (see below). The =default solution in C++20 is by far the nicest so I would go with that if you can.

Your feeling is right definitely don’t use memcmp for comparing structs, it most likely won’t give you the correct result anyway.

If you can’t use C++20 I would do it this way:

inline bool operator==(const FText& lhs, const FText& rhs)
{
  return lhs.EqualTo(rhs);
}

inline bool operator==(const FKani_InventoryItemWidgetInfo& lhs, const FKani_InventoryItemWidgetInfo& rhs)
{
  return Tie(lhs.Label, lhs.Icon, lhs.bExists, lhs.bIsEmpty, ...)
      == Tie(rhs.Label, rhs.Icon, rhs.bExists, rhs.bIsEmpty, ...);
}

I find it a bit cleaner than comparing all members individually.