Nonstatic Member Function

1. 改写函数原型,参数变为this指针。
2. 将所有成员变量的存取操作都转化为经this指针的操作。
3. 将此函数重写为一个外部函数并导出，名称进行 Name Mangling。最后函数的调用形式也随之改变：obj.magnitude()转化为类似于magnitude_7Point3dFv(&obj)这种名称

Deep in Virtual Function

单继承下的虚函数

• 无论ptr对应哪种对象，我们总是可以通过ptr找到对应对象的vtable
• 无论ptr对应哪种对象，g函数的地址总是在slot 3位置

纯虚函数为什么等于0

The curious =0 syntax was chosen over the obvious alternative of introducing a new keyword pure or abstract because at the time I saw no chance of getting a new keyword accepted. Had I suggested pure, Release 2.0 would have shipped without abstract classes. Given a choice between a nicer syntax and abstract classes, I chose abstract classes. Rather than risking delay and incurring the certain fights over pure, I used the tradition C and C++ convention of using 0 to represent “not there.” The =0 syntax fits with my view that a function body is the initializer for a function also with the (simplistic, but usually adequate) view of the set of virtual functions being implemented as a vector of function pointers.

普通多继承下的虚函数

• b1不需要调整this指针（最左边的类）
• b2需要调整this指针

b2来说，构造函数必须调整对象地址，使其指向Base2 sub-object（当然析构函数也是）：