A
Angus
Why moving a function from protected to public area in class causes
error C2556 - overloaded function differs only by return type
I have a protected function called GetState like this:
enum EState GetState(void) const throw();
If I move this function from protected: to public: I get this compile
error:
xbasicsocket.cpp(247) : error C2556: 'enum CXBasicSocket::EState
__thiscall CXBasicSocket::GetState(void) const' : overloaded function
differs only by return type from 'enum EState __thiscall
CXBasicSocket::GetState(void) const'
\xbasicsocket.h(154) : see declaration of 'GetState'
\xbasicsocket.cpp(247) : error C2371: 'GetState' : redefinition;
different basic types
\xbasicsocket.h(154) : see declaration of 'GetState'
In the cpp file it is declared like this:
enum CXBasicSocket::EState CXBasicSocket::GetState(
) const throw()
{
return m_eState;
}
Why am I geting this problem? How do I resolved?
error C2556 - overloaded function differs only by return type
I have a protected function called GetState like this:
enum EState GetState(void) const throw();
If I move this function from protected: to public: I get this compile
error:
xbasicsocket.cpp(247) : error C2556: 'enum CXBasicSocket::EState
__thiscall CXBasicSocket::GetState(void) const' : overloaded function
differs only by return type from 'enum EState __thiscall
CXBasicSocket::GetState(void) const'
\xbasicsocket.h(154) : see declaration of 'GetState'
\xbasicsocket.cpp(247) : error C2371: 'GetState' : redefinition;
different basic types
\xbasicsocket.h(154) : see declaration of 'GetState'
In the cpp file it is declared like this:
enum CXBasicSocket::EState CXBasicSocket::GetState(
) const throw()
{
return m_eState;
}
Why am I geting this problem? How do I resolved?