ALL,
Could someone please explain why following:
class Document
{
public:
std::vector &GetVector() const { return m_myStringVector; };
private:
std::vector m_myStrngVector;
};
gives:
error C2440: 'return': cannot convert from 'const std::vector<std::wstring,std::allocator<_Ty>>' to 'std::vector<std::wstring,std::allocator<_Ty>> &'
with
[
_Ty=std::wstring
]
note: Conversion loses qualifiers
It is a simple getter and don't need to be declared as const.
What am I missing?
