I came across the following code,
class Handler
{
public:
Handler() {}
~Handler() {}
enum HANDLER_PRIORITY {PRIORITY_0, PRIORITY_1, PRIORITY_2};
virtual HANDLER_PRIORITY GetPriority();
private:
HANDLER_PRIORITY m_priority;
}
in the .cpp file I have this
HANDLER_PRIORITY Handler::GetPrioity()
{
return PRIORITY_0;
}
I get a compilation error, "missing type specifier - int assumed. Note: C++ does not support default-int"
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.
I am on VS 2008.