关于const

这里的const 表示

1 void Manager::print() const {}

这叫函数签名。
表示 成员函数的 this 指针,所指对象是函数内部,不可以改变的。
就是把 this 指针 定义成这个样子:
const Manager * this const;
 对比一下:
1)void Manager::print() const {}的this 指针 
const Manager * this const;

2)void Manager::print() {}的this 指针 
 Manager * this const;

类的成员函数后面加 const,
表明这个函数不会对这个类对象的数据成员(准确地说是非静态数据成员)作任何改变。 

原文地址:https://www.cnblogs.com/huhaibo/p/3430528.html