title: returning enum from function in C++ base class
body: <p>I came across the following code,</p>
  
  <pre><code>class Handler
  {
  public:
     Handler() {}
     ~Handler() {}
  
      enum HANDLER_PRIORITY {PRIORITY_0, PRIORITY_1, PRIORITY_2};
  
      virtual HANDLER_PRIORITY GetPriority();
  private:
      HANDLER_PRIORITY m_priority;
  }
  </code></pre>
  
  <p>in the .cpp file I have this</p>
  
  <pre><code>HANDLER_PRIORITY Handler::GetPrioity()
  {
     return PRIORITY_0;
  }
  </code></pre>
  
  <p>I get a compilation error, "missing type specifier - int assumed. Note: C++ does not support default-int"</p>
  
  <p>I know that unlinke C, C++ does not support default-int return. but why would it not recognize an enum return type. It works fine if I replace return type from HANDLER_PRIORITY with int/ void, OR if I define the method in the class itself. (inline) OR change the return type to Handler::HANDLER_PRIORITY.</p>
  
  <p>I am on VS 2008.</p>