Don wrote:
Yes. This is something the compiler can't (or shouldn't) do.
It shouldn't do it. If a memberwise compare is done, it should do them in order. This allows the struct designer to lay out the fields optimally (similarly to how case statement order affects efficiency in switch statements).