why the following code throws this error:
IntelliSense: qualifiers are discarded by bindings of type "string &" for an initializer of type "const string"
.h
class A { public: wstring& GetTitle() const; private: wstring title; };
.cpp
wstring& GetTitle() const { return this->title; }
If I delete the const word, it stops complaining , and yet I never made any changes to the variable?
source share