-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<numeric>: non conformance of std::reduce() #891
Comments
Per [reduce]/5 we are required to diagnose this program as ill-formed now since the requirement is a "Mandates" instead of the previous "Requires". I suspect there may be other similar cases in which a less-than-useful C++17 "Requires" became a C++20 "Mandates" which we will fail to diagnose due to the aforementioned lack of utility. That said, I don't think it would be a worthwhile investment of our time to audit every such change looking for them. Other maintainers, shout if you disagree. We need to audit both serial and parallel implementations of |
The convertibility requirements are bogus but most of the callability requirements are real, I think? Rejecting this code (which is totally misusing |
|
I think that the requirements are sufficient (and in this case necessary) if all intermediate Let
The following requirements are sufficient and necessary:
|
The permissible expansions of |
It isn't strictly necessary to convert Example (shouldn't compile)
|
Yes, the intent of the conversions to |
WG21-P0571R2 is supposed to resolve the issue of |
Describe the bug
in std::reduce(), binary_op(*first,*first) must be convertible to T. This isn't the case in the below code yet it compiles.
Command-line test case
Expected behavior
It shouldn't compile
STL version
Microsoft Visual Studio Community 2019 Version 16.6.1
Additional context
gcc and clang reject the above code
The text was updated successfully, but these errors were encountered: