1#include <iostream>
2using namespace std;
3
4
5int main() {
6 cout<< "Hello World" ;
7}
8
9//If you are a web developer, please give https://code.ionicbyte.com/ a try
1namespace Parent
2{
3 inline namespace new_ns
4 {
5 template <typename T>
6 struct C
7 {
8 T member;
9 };
10 }
11 template<>
12 class C<int> {};
13}
14
1//Header.h
2#include <string>
3
4namespace Test
5{
6 namespace old_ns
7 {
8 std::string Func() { return std::string("Hello from old"); }
9 }
10
11 inline namespace new_ns
12 {
13 std::string Func() { return std::string("Hello from new"); }
14 }
15}
16
17#include "header.h"
18#include <string>
19#include <iostream>
20
21int main()
22{
23 using namespace Test;
24 using namespace std;
25
26 string s = Func();
27 std::cout << s << std::endl; // "Hello from new"
28 return 0;
29}
30