With C++20 it's possible to default comparison operators. With has_unique_object_representations and an intrinsic to detect if type is trivially equality comparable (it has defaulted operator== and all of it's members are trivially equality comparable) we could greatly increase number of cases when equal uses memcmp.
It would be great if we could default operator== for types like tuple and pair, but I don't know if we can do that.
With C++20 it's possible to default comparison operators. With
has_unique_object_representationsand an intrinsic to detect if type is trivially equality comparable (it hasdefaultedoperator==and all of it's members are trivially equality comparable) we could greatly increase number of cases whenequalusesmemcmp.It would be great if we could
defaultoperator==for types liketupleandpair, but I don't know if we can do that.