发现一个奇怪的问题,mark
class Demo { public: std::vector<int> *getVector()const; int *getInt()const; private: std::vector<int> m_vecInt; int m_int; }; std::vector<int> *Demo::getVector()const //这个const变成修饰返回值了??? { return &m_vecInt; //编译出错,无法从"const std::vector<int>* "转换为"std::vector<int>*" } int *Demo::getInt()const //ok { return &m_int; }