https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116342

--- Comment #4 from Zhao Dai <daidodo at gmail dot com> ---
> floating point is a fundamental types so there is no ADL involved ...

Thanks for pointing out! I checked other types (int/bool/nullptr_t/type
alias/...), and it seems all builtin types and their alias are excluded by ADL
thus cannot have customised weak/strong_order.

> IIUC GCC and libstdc++ are doing the right thing - you're just not allowed to 
> customize comparison for float.

I don't know if C++ Standard says `strong/weak_order` are customisable only for
user-defined types. If yes, I'm happy to know.

Otherwise, since libstdc++ is customising float comparison with assumptions,
e.g -NaN < -INF < 0 < +INF < +NaN, it sounds like a defect to me if libstdc++
doesn't allow any other assumptions and use cases.

Another angle is the original intention of partial/weak/strong_order
customisation points. My understanding is that they "promote" order categories
when needed, like from partial_ordering to weak/strong_ordering for floating
point types. If it's one of the intentions, I don't see why builtin types and
their alias should be excluded.

Reply via email to