2013年4月25日

const_cast Operator,dynamic_cast Operator,static_cast Operator,reinterpret_cast Operator

摘要: const_cast Operatorconst_cast < type-id > ( expression )The const_cast operator can be used to remove the const, volatile, and __unaligned attribute(s) from a class.用于取消变量的const、volatile、__unaligned属性。详见msdn:http://msdn.microsoft.com/en-us/library/bz6at95h(v=vs.71).aspx dynamic_cast Operatordy 阅读全文

posted @ 2013-04-25 22:06 Waaaaaall-E 阅读(248) 评论(0) 推荐(0)

子类的拷贝构造函数和赋值操作符

摘要: 摘自:http://blog.csdn.net/czx32296429/article/details/6659054 在定义子类的 拷贝构造函数 和 赋值操作符 时,基本的原则是子类一定要调用父类的相应函数,以下定义了父类Base类和子类Derived类来说明两个函数的写法:class Base{public: Base(){} virtual ~Base(){} Ba... 阅读全文

posted @ 2013-04-25 21:19 Waaaaaall-E 阅读(213) 评论(0) 推荐(0)

导航