Just teaching myself c++ namespaces (coming from a c# background) and i'm really starting to think that all the things that c++ does better then most other languages, nested namespaces isn't one of them!
Am i right in thinking that in order to declare nested namespaces i HAVE to do the following:
namespace tier1
{
namespace tier2
{
namespace tier3
{
/* then start your normal code nesting */
}
}
}
as apposed to:
namespace tier1::tier2::tier3
{
}
ala c#.
This becomes even more demented when i need to forward declare:
namespace tier1
{
namespace tier2
{
namespace forward_declared_namespace
{
myType myVar; //forward declare
}
namespace tier3
{
/* then start your normal code nesting */
class myClass
{
forward_declared_namespace::myType myMember;
}
}
}
}
Bearing in mind that a typical system that i develop consists of:
MyCompany::MySolution::MyProject::System::[PossibleSections]::Type
Is this why you don't tend to see much use of namespaces in c++ examples? or usually on single (un-nested) namespaces?