Function 語意學
static member functions 不可能做的
·存取 nonstatic 數據
·被聲明為 const
·virtual
·volatile
this
·T* const this
·const T* const this
名字的特殊處理 name mangling
名字_類名_參數鏈表
((Point3d*)0)->object_count();
virtual member functions
虛擬成員函數
任何問題都可以通過添加一個中間層來解決,實現多態就是通過添加了一個虛函數表和虛函數表指針這個中間層實現的
多重繼承下的 virtual functions
thunk
address points
virtual base class
不要聲明 nonstatic data member
構造函數的調用
指向 member function 的指針
double (Point::*pmf)();
指向 virtual member functions 的指針
ptr->z()
(ptr->*pmf)();
指向成員的指針實質是索引,而不是地址
在我看來不管是 virtual member functions 的指針還是 nonvirtual member functions 的指針
posted on 2011-06-01 13:45
unixfy 閱讀(188)
評論(0) 編輯 收藏 引用