With Concepts, we will also have "auto" in function arguments. It avoids "template <typename ...>" for simple functions.
I already use it as a "catch all" over specialized functions (gcc -std=c++17).
I already use it as a "catch all" over specialized functions (gcc -std=c++17).
int foo(auto a, auto &&b);
to int foo(a, &&b);
? Too big a change? Too much magic? Maybe more difficult to read or parse. The argument "It's not clear that the function is a template" isn't there any more, though, so it seems reasonable to me.Interestingly, I remember hearing about this exact problem in the context of Swift's closures; if you want type inference, you need to leave off the parens around the parameters. This is mainly done (IIRC) because it's easier for the parser.
[1] http://blog.reverberate.org/2013/08/parsing-c-is-literally-u...
template <typename T1,typename T2>
int foo(T1 a, T2 &&b);
"auto" is shorter.