Which operator is used with a namespace to distinguish between functions, classes, and variables? code example
Example: access the namespace members using namespace member function
//Header.h
#include
namespace Test
{
namespace old_ns
{
std::string Func() { return std::string("Hello from old"); }
}
inline namespace new_ns
{
std::string Func() { return std::string("Hello from new"); }
}
}
#include "header.h"
#include
#include
int main()
{
using namespace Test;
using namespace std;
string s = Func();
std::cout << s << std::endl; // "Hello from new"
return 0;
}