posts - 183,  comments - 10,  trackbacks - 0

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 阅读(174) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理