namespace c code example
Example 1: c++ custom namespace
//using namespaces
using namespace std;
//creating namespaces
namespace custom{
class example{
public:
static int method(){
return 0;
}
};
};
//using custom namespaces
using namespace custom;
Example 2: access the namespace members using namespace member function
namespace Parent
{
inline namespace new_ns
{
template <typename T>
struct C
{
T member;
};
}
template<>
class C<int> {};
}