Boost logo

Boost :

From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2020-07-22 16:25:12

On 22/07/2020 15:59, Alexander Grund via Boost wrote:
> Am 22.07.20 um 16:56 schrieb Peter Dimov via Boost:
>> Niall Douglas wrote:
>>> For some reason I don't understand, clang in C++ 20 mode seems to
>>> loop the result == outcome step i.e. in the constraints that result
>>> == outcome is available if and only if outcome == result is
>>> available, it considers the availability of the result == outcome
>>> overload itself.
>> Probably caused by C++20 operator rewriting that was introduced as
>> part of the op<=> changes. The gift that keeps giving.
> BOOM, yes! Good idea, I guess that's it.

You've suddenly reminded me why I had added the below check:

> Maybe the "#if __cplusplus <= 202000L" I mentioned earlier was meant to
> say "#if __cplusplus < 202000L" due to this?

The check is good, as the official value is 202002L. But it is
misleading. I will fix it.

That test failure in Outcome has been around for so long now that I had
originally thought of C++ 20 operator rewriting, added that check, then
forgot that, and now we are here. The reason why clang still fails is
because it sets __cplusplus to 2017, even if it's been told it is in C++
20, which is extremely unhelpful of it.

So Peter, seeing as you're the closest person to an expert in C++ 20
operator rewriting that I know of (and there is absolutely nothing about
this on the internet), can you tell me if C++ 20 automagically rewrites
an available operator==(A, B) into an operator==(B, A) with no further
suggestion? i.e. if I simply #ifdef out that code if on C++ 20 or later,
am I good?


Boost list run by bdawes at, gregod at, cpdaniel at, john at