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