const_cast 主要是去掉const 的强转 class Base { public: void init() { cout << "init Draw" << endl; } void update() const { cout << "init Draw" << endl; } }; int main() { const Base* a = new Base(); //a->init(); 编译报错 无法非const对象 a->update(); Base* b=const_cast<Base*>(a);//去掉const b->init(); }