转换和继承,虚函数 Understanding conversions between base and derived classes is essential to understanding how object-oriented programming works in C++. 理解基类和派生类之间的转换是不可缺少的 理解面向对象编程在. Like built-in pointers, the smart pointer classes (§12.1, p. 450) support
本文翻译自modern effective C++,由于水平有限,故无法保证翻译完全正确,欢迎指出错误.谢谢! 博客已经迁移到这里啦 C++中的面向对象编程总是围绕着类,继承,以及虚函数.这个世界中,最基础的概念就是,对于一个虚函数,用派生类中的实现来重写在基类中的实现.但是,这是令人沮丧的,你要认识到重写虚函数有多么容易出错.这就好像这部分语言,是用这样的概念(墨菲定律不仅仅要被遵守,更需要被尊敬)来设计的.(it's almost as if this part of the languag