how to decalre namespace?

i know how to declare + definite but how can i only declare it?

if i declare and definite in one cpp file, i can do it... but i want to declare a namespace in .h and definition of the namespace to be in .cpp

for example
1
2
3
namespace X{
statement
} // this would declare and definite in same file.. 


whats the syntax for clean namespace declaration?

like in functions:

void FUNC(){}; // <== its declaration+Definition
&&
void FUNC(); // <== its declaration only
Every namespace declaration is either original-namespace-definition (if the name hasn't been seen yet) or an extension-namespace-definition (if the name was already defined).

You could use an empty definition that you extend later

1
2
3
4
5
namespace X {} // original-namespace-definition, with no members
// ...
namespace X { // extension-namespace definition, with members
  namespace-member-declaration;
}


but it doesn't make the names declared in the extension visible to the code that can see the original definition.
yah i know about your code, my question was if its allowed for me to declare an namespace and then the program to search automatically for the definition like in functions.. but i guess there is no such a option in namespaces...
Topic archived. No new replies allowed.