Relationship between function calls and Parameters

Source: Internet
Author: User


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 ..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.