Declaring and accessing an enum in a singleton class- C++
<p>C++ Beginner Question!</p>

<p>If there is an enum in the public section of a singleton class, what is the correct way to use the <strong>enum values</strong> from outside the singleton class.</p>

<pre><code>class MySingletonClass
{
    public:
      static MySingletonClass &amp; Singleton();

      enum
      {
          eCodeZero         = 0,
          eCodeOne      = 1
      }MsgQueueCodes;
    protected:

          MySingletonClass ();
          ~MySingletonClass ();
};
</code></pre>

<p>I was able to access the enum values like this from outside this class.</p>

<pre><code>MySingletonClass::Singleton().eCodeZero
MySingletonClass::Singleton().eCodeOne
</code></pre>

<p>My question is,</p>

<ol>
<li>Is this the proper way to do this?</li>
<li>Is there any alternate ways exist?</li>
<li>What is the syntax for declaring an enum variable in another class? [need to do something like <code>MySingletonClass::MsgQueueCodes myMsgQCode;</code> // Not the correct syntax]</li>
</ol>

<p>Thank you for your time.</p>
