C++ namespaces as modules?
<p>In the past, I would write classes like this:</p>

<pre><code>// my_class.h

class MyClass
{
public:
    // Signals emitted by MyClass objects.
    typedef boost::signal&lt;..&gt; SignalA;
    typedef boost::signal&lt;..&gt; SignalB;

    enum SomeEnum
    {
        ..
    };

    enum AnotherEnum
    {
        ..
    };

    typedef some_type SomeOtherType;

    // an exception thrown by MyClass objects
    class ExceptionA
    {
        ..
    };

    MyClass();

   // rest of class definition omitted
};
</code></pre>

<p>The thing I always hated about this style is that it convoluted the class declaration.  So then for a recent project I decided to try something new.  I decided to use namespaces in a fashion similar to that of modules in Python (we also use Python a lot where I work):</p>

<pre><code>// my_class.h

namespace my_class
{
    // Signals emitted by MyClass objects.
    typedef boost::signal&lt;..&gt; SignalA;
    typedef boost::signal&lt;..&gt; SignalB;

    enum SomeEnum
    {
        ..
    };

    enum AnotherEnum
    {
        ..
    };

    typedef some_type SomeOtherType;

    // an exception thrown by MyClass objects
    class ExceptionA
    {
        ..
    };

    class MyClass
    {
    public:
        MyClass();
        ..
    };
}
</code></pre>

<p>And the result wasn't too bad.  The only downside is that you always had to prefix "my_class::" before everything.  But that could be alleviated by utilizing "using" statements.</p>

<p>I am about start another project and I was thinking of doing this again.  Are there any serious downsides (other than increased verbosity) to adopting this use of namespaces?</p>
