Closed nebularnoise closed 3 years ago
Thank you. I see. I need to set up a proper CI matrix for many compilers, to ensure a change for one compiler doesn't accidentally break something for another. I'll come back to you with this.
I set up a CI matrix, and unsurprisingly it fails C++20 builds, exactly as you showed. Unfortunately your fix causes clang builds to fail because of incorrect use of an incomplete type. Apparently some other mechanism is needed to break the recursion.
Solving this was trickier than I thought. C++20 introduced a new rule that if you have A::operator==(B), then B==A compiles by trying A==B, which caused the infinite recursion. Breaking this conditionally was tricky, especially since I also learned that compilers are unfaithful with the __cplusplus
macro, so a preprocessor check did not work. MSVC still hates the code, but several clang++/g++ compiles it warning free in both C++17 and C++20 mode. Closing this now. Thank you for bringing this to my attention.
Oof, I see you've had to jump through some hoops indeed !
Thanks for the fix, and for such a quick response :)
Makes the lib build in GCC 10.2 with std=c++20
Before adding this change, this was the compiler error: