17 Templates [temp]

17.6 Name resolution [temp.res]

17.6.3 Non-dependent names [temp.nondep]

Независимые имена, используемые в определении шаблона, обнаруживаются с помощью обычного поиска по именам и привязываются к месту их использования. [Example:

void g(double);
void h();

template<class T> class Z {
public:
  void f() {
    g(1);           // calls g(double)
    h++;            // ill-formed: cannot increment function; this could be diagnosed
                    // either here or at the point of instantiation
  }
};

void g(int);        // not in scope at the point of the template definition, not considered for the call g(1)

end example]