Namespace X {template <typename T> void F (t);} namespace n {using namespace X; Enum E {E1}; void F (e) {cout <"N:: F (E) "<Endl;} // void F (INT) // if this function is enabled, the function f in scope N is ambiguous with the function f outside. // {//} void F (INT) {cout <": F (INT)" <Endl;} int _ tmain (INT argc, _ tchar * argv []) {// int type parameter: F (1); // output: F (INT) F (1); // output :: F (INT) cout <Endl; // variable parameter: F (N: E1); // output: F (INT) f (N: E1 ); // output N: F (INT). Why is it called to namespace N after the parameter is changed? Cout <Endl; // Add using namespaceusing namespace N;: F (1); // output: F (INT) F (1); // output :: F (INT), although using namespace N is declared here; but it still calls the external function. cout <Endl; // change the parameter using namespace N;: F (N: E1); // output: F (INT) f (N: E1 ); // output N: F (INT) getchar (); Return 0 ;}
It can be seen that function calls are related to parameters ..