21 Feb
2023
21 Feb
'23
12:15 a.m.
On 2/21/23 03:00, Peter Dimov via Boost wrote:
Andrey Semashev wrote:
Isn't the result of "==" always boolean?
The result can have any type. However, the rewritten candidates for operator== are only generated when the result is bool, so expression templates should be unaffected by this operator rewriting.
That would have made too much sense. Have faith in the committee.
Instead, it's an error if a rewritten candidate doesn't return bool.
In that case, maybe I should file a gcc feature request to add an attribute preventing operator rewriting. Maybe then C++20 will be usable.