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
[std] Where template can be replaced with auto, or vice versa #4822
Comments
Keeping them symmetrical with the other overloads seems more useful than whatever benefit might come from using
Those names are used in the function bodies in actual implementations. I am not persuaded that changing them has any benefit. |
Thanks for the survey though! |
I think if we want a policy, then "a sink or catch-all where you don't care about the names or types of the parameters" seems like a good place to use For other cases, I don't have a good suggestion (or preference). The survey here shows there aren't too many examples where it matters. Maybe "if it's plausible that the specification, or just an implementation, would want to name the types, then use a
Now that I look at the line above, I think I do like it for |
That does seem like an improved I'd refine the first suggestion for a policy to -a sink or catch-all where you don't care about the names or types of the parameters
+a sink or catch-all where the names and types of the parameters don't matter I think that's less subjective and might include (perhaps not clearly enough) the case where it does matter for an implementation. As usual, I agree with your points. |
That's much better phrasing, and I think it does nicely cover the "might need to refer to them in the spec or an impl" case as well as the "sink with unused/ignored arguments" case. |
Editorial meeting consensus: The proposed policy #4822 (comment) sounds good, and we should adopt it. Only very few parts of the standard are affected. We welcome pull requests to change We can also make the reverse change in individual cases where there is a clear benefit, without having a wider policy. |
See #4822 for the general policy on when to use abbreviated function template syntax.
Following the discussion at #4817, I searched the WD for
&&...
and found some places where these could be swapped.=delete
d overloads. Perhaps useful for symmetry with the non-deleted overloads.emplace
{,_hint
}, [multimap.overview], [set.overview], [multiset.overview], [unord.map.overview]'semplace
{,_hint
}, [unord.multimap.overview], [unord.set.overview], [unord.multiset.overview].The text was updated successfully, but these errors were encountered: