This allows std::equal and other algorithms be optimized better.
I think this LGTM w/ comments applied, but I'd like to see it one last time w/ green CI and comments applied before we ship this.
libcxx/test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp is very very light, it doesn't even test for != -- can you add a test for that?
Please add a comment explaining that this allows making the class trivially equality comparable.
Please add a comment like:
// conforming extension: this is not observable beyond SFINAE but it allows making `unexpected` trivially comparable
Same thing, please add a comment throughout whenever it's a public API. For example not in __wrap_iter.
No need for public:, we're already in public. Please check throughout.
Can you please ensure that we have tests for comparing tuples that contain reference types?
Conforming extension comment?
Per your comment, you might be able to uncomment this now.
About your CI issues, I think this might be a compiler bug:
I think they should both work on all compilers.
Edit: The problem seems to be that Clang and MSVC will instantiate operator== a bit too eagerly: https://godbolt.org/z/5hMKWzoMs, which triggers ADL on Holder<Incomplete>.