摘要: C++风格的强制类型转换:const_cast,static_cast,dynamic_cast,reinterpret_cast。使用:xxx_cast (expression)const_cast说明:该运算符用来修改类型的const或volatile属性。 1 class TestA 2 { 3 public: 4 TestA() { } 5 public: 6 int m_data; 7 }; 8 9 void foo()10 {11 const TestA ta;12 //ta1.m_data = 100; //编译错误13 14 Te... 阅读全文
posted @ 2014-01-05 21:37 helloamigo 阅读(283) 评论(0) 推荐(0) 编辑