For example, the following codes will not be accepted.
void foo(auto i){ cout<<(i+1); }
I think it should be equivalent to the following accepted codes
template<typename T> void foo(T i){ cout<<(i+1); }
Thus, the compiler should be able to deduce (or instantiate) the type of parameters. But why not work?
thanks a lot: -)
source share