Hacker News new | ask | show | jobs
by eeegnu 1759 days ago
Something about type constraining auto just seems funny. I can see how it's useful from an error minimization / code clarity standpoint, but it almost seems counter to the point of even using auto.
2 comments

Initially auto was not required (nor allowed). The concept name itself was enough. Adding auto is one of those compromises that please no one but was necessary to move the proposal forward
I belive that you do not sufficiently understand the giant footgun that is unconstrained auto, especially in the context of very template-heavy code. Concepts solve the issue that judicious use of auto will allow template instantiations to succeed that are plain wrong in that they will happily do the wrong thing just because the types involved fit the constraints by mere chance and not because they were meant to be used together like this.
Unconstrained auto is unwise in globally accessible templates that participate in overload resolution, but is fine in lambda literals.