I was wondering if you guys could help me.
Here are my .h:
Class Doctor {
const string name;
public:
Doctor();
Doctor(string nam
The declaration is Doctor &operator=(const Doctor &other);
(i.e., remove the Doctor::)
from there you'd need to use const_cast<> to remove the const-ness of the member variable to make it work. Note that only heartbreak lies in the path you've chosen.
I'd recommend removing const from the member declaration and instead making member functions const as necessary to show that they won't affect the object. (For example if you have an accessor member function you could declare that const: string getName() const { return m_name; }
)