Compiler Error C2663

'function' : number overloads have no legal conversions for 'this' pointer

The compiler could not convert the this pointer to any of the overloaded versions of the member function.

This error may be caused by invoking a non-const member function on a const object. To correct the problem, remove the const from the object declaration or add const to one of the member function overloads.

The following is an example of this error:

class C {
public:
   void foo() volatile;
   void foo(); // adding const here would fix problem
};

const C *pcc;

void main()
{
   pcc->foo();      // error
}