Can I overload the assignment operator for a class with a const member? The following class is a minimal example, in my case, there is a private const string. The copy constructor is straightforward.
If I cannot provide an assignment operator, what can I do to make the compiler warning C4512 go away?
class cTest
{
public:
cTest();
cTest(int i);
cTest(const cTest & other);
cTest & operator= (const cTest& other);
private:
const int m_i;
};
EDIT: The question remains: If I cannot provide an assignment operator, what can I do to make the compiler warning C4512 go away? Why does the warning arise?