why does the following throw this error:
IntelliSense: qualifiers dropped in binding reference of type
"string &" to initializer of type "const string"
.h
class A
{
public:
wstring& GetTitle() const;
private:
wstring title;
};
.cpp
wstring& GetTitle() const
{
return this->title;
}
If i remove the const word, it stops complaining, and yet i have never made any changes to the variable?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…