[libcxx-commits] [libcxx] [libc++] Avoid -Wzero-as-null-pointer-constant in operator<=> (PR #79465)

Martin Hořeňovský via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 29 02:52:29 PST 2024


horenmar wrote:

> Ok, so IIUC basically you need the == 0 condition to be something that SFINAEs-away the overload. 

Assuming I understand you correctly, yes. Something like `requires( const T& lhs, const U& rhs ) { lhs == rhs; }` should evaluate to false for `T = std::*ordering` and `U = int`,  but something like ` requires( const T& lhs, const U& rhs ) { lhs == 0; } ` should be true.


https://github.com/llvm/llvm-project/pull/79465


More information about the libcxx-commits mailing list