We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

14.6.2 Dependent Names

The Visual C++ compiler does not currently support binding nondependent names when initially parsing a template. This can cause overloads to be declared after the template (but before the template is instantiated) to be seen.

// DependentNames.cpp
#include <stdio.h>
namespace N {
   void f(int) { printf("f(int)\n");}
}

template <class T> void g(T) {
   N::f('a');   // calls f(char) should call f(int)
}

namespace N {
   void f(char) { printf_s("f(char)\n");}
}

int main() {
   g('c');
}

Output

f(char)
Show: