Given a template function, that does not use the template parameter for input directly. How would C++ type inference work? For instance given
template<typename T>
void f(T::value_type){}
when (if at all) will type inference work for this function?
Is there any other place except of template<typename T1,...>void f(T1,T2,...) where type inference might occur?
As always, quote the standard for extra credit.
I think here’s your answer:
Your
T::value_typeis a qualified-id of a type, so types in its nested-name-specifier are nondeduced and must be specified explicitly.Edit: this information is from ISO/IEC 14882:1998.