C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Let spaceship return an int

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 27 Sep 2023 08:05:32 -0700
On Wednesday, 27 September 2023 03:33:11 PDT Gašper Ažman via Std-Proposals
wrote:
> That's the design, and if you bring "int" into it you're basically
> implicitly saying int maps to partial order, which is the most useless and
> barely ever the right choice.

And that goes back to my argument about combination.

If it were just int for everything, then a combination of std::tuple of only
fully-orderable types couldn't simply combine signs like Chris is suggesting
could be optimal code. Instead, it would need to do actual value comparisons.

Example:
https://gcc.godbolt.org/z/jcqas5eYr

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-09-27 15:05:33