Came across the following task in a test:
#include <iostream> using namespace std;
template<typename T> void adl(T) { cout << "T"; }
struct S { };
template<typename T> void call_adl(T t) { adl(S()); adl(t); }
void adl(S) { cout << "S"; }
int main () { call_adl(S()); }
The question is which functions will be called. There is also an explanation that the name of the function which does not depend on a template argument is resolved at the time of template definition, while the name of those which do depend on a template argument is resolved when a template argument is known. Well, what's the difference between these "times"?