When declaring a class inside a namespace, especially if it's inside
multiple namespaces, there's a small but slightly annoying problem:
Indentation. In other words:
namespace NS1
{
namespace NS2
{
class MyClass
{
public:
// stuff
};
}
}
The contents of the class will be highly indented, which can be mildly
annoying. You could of course ignore the indentation of namespaces,
but that's bad form (and also annoying with editors that autoindent).
There is, however, a small trick to avoid that. Namely:
namespace NS1 { namespace NS2 { class MyClass; } }
class NS1::NS2::MyClass
{
public:
// stuff
};
I was wondering if the same trick could be used with nameless namespaces.
--- news://
freenews.netfront.net/ - complaints:
ne...@netfront.net ---