Date: Wed, 16 Mar 2022 11:54:36 +1300
On 15/03/2022 10:23 pm, Jake Arkinstall via SG14 wrote:
> I cannot think of any use I'd have of such comparisons, except for niche
> cases where I'd happily just iterate (e.g. tests).
But in that case, there is a use for a comparison operator. Perhaps not
a <=> operator, but certainly a comparison operator - and keeping ==
prevents people from having to roll their own code.
> Based on that, and that alone, I'd go for the no built-in comparison
> route for now, with the option of adding one later if a solid use case
> comes along.
>
> That is, unless a plan involves storing some composable hash in each
> block (customising by template args might give the user choice of
> ordered/unordered comparisons? Not sure on that one, just spitballing),
> in which case ABI prevents the later change.
That wouldn't really help with comparing across the entire container.
> I cannot think of any use I'd have of such comparisons, except for niche
> cases where I'd happily just iterate (e.g. tests).
But in that case, there is a use for a comparison operator. Perhaps not
a <=> operator, but certainly a comparison operator - and keeping ==
prevents people from having to roll their own code.
> Based on that, and that alone, I'd go for the no built-in comparison
> route for now, with the option of adding one later if a solid use case
> comes along.
>
> That is, unless a plan involves storing some composable hash in each
> block (customising by template args might give the user choice of
> ordered/unordered comparisons? Not sure on that one, just spitballing),
> in which case ABI prevents the later change.
That wouldn't really help with comparing across the entire container.
Received on 2022-03-15 22:54:42