[libcxx-commits] [libcxx] [libc++] Make __synth_three_way cheaper to build in common case (PR #227580)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 6 01:45:29 PDT 2026


philnik777 wrote:

Actually, why to we save so much compile time in the first place? `three_way_comparable_with<T, T>` is just `three_way_comparable<T>` checked three times.

> > Is it possible to short-circuit in `three_way_comparable_with` instead? As-is this seems very ad-hoc.
> 
> I don't think so: three_way_comparable_with is a concept per standard, which can't be specialized without affecting overload resolution, as far as I know.

I think we might be able to do something like `same_as<T, U> || (stuff that's only relevant if T != U)`. Though I don't understand concepts well enough to say whether that would affect overload resolution, and I'm not sure who to ask. @cor3ntin do you possibly know enough about concepts to give an answer here?

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


More information about the libcxx-commits mailing list