1 #include2 using namespace std; 3 4 5 6 7 8 namespace all 9 {10 //inline作用为默认调用11 inline namespace V201712 {13 void fun(int num)14 {15 cout << "int" << "V2017" << endl;16 }17 }18 namespace V201819 {20 void fun(int num)21 {22 cout << "int" << "V2018" << endl;23 }24 25 void fun(double num)26 {27 cout << "double" << "V2018" << endl;28 }29 }30 }31 32 void main()33 {34 all::fun(1);35 all::V2018::fun(1);36 cin.get();37 }