The C++ type trait `has_unique_object_representations` is fundamentally flawed and shouldn't be used to determine if a type is trivially equality-comparable. While it correctly rejects types with padding or non-trivial representations, it produces false positives (like `optional<char>` and `polymorphic_allocator`) by ignoring
Table of contents
Okay, but has_unique_object_representations …?1. libc++’s optional<char> (false positive)2. optional<int&> (false positive)3. pmr::polymorphic_allocator<int> (false positive)4. span<int> (false positive)5. libstdc++’s exception_ptr (false negative)Conclusion and postscriptSort: