inline namespaces code example

Example: inline_namespace

#include <iostream>

using namespace std;

namespace AppVersion{
    namespace version1{
        void display(){
            cout <<"display function from the version 1"<<endl;
        }
    }
    namespace version2{
        void display(){
            cout<< "display function from the version 2"<<endl;
        }
    }
 inline   namespace version3{
        void display(){
            cout<< "display function from the version 3"<<endl;
        }
    }
      namespace version3{
        void whatsUp(){
            cout<< "whatsup function from the version 3"<<endl;
        }
    }

}


int main()
{
    AppVersion :: display();
    AppVersion :: whatsUp();
    return 0;
}

Tags:

Cpp Example