
学习笔记
雷禅
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
触发动态绑定的2个条件
By default, function calls in C++ do not use dynamic binding. To trigger dynamic binding, two conditions must be met: First, only member functions that are specified as virtual can be dynamically bound. By default, member functions are not virtual; nonvirt原创 2011-02-15 16:33:00 · 1337 阅读 · 0 评论 -
友元和继承
<br />Friendship is not inherited. Friends of the base have no special access to members of its derived classes. If a base class is granted friendship, only the base has special access. Classes derived from that base have no access to the class granting fr原创 2011-02-15 16:50:00 · 483 阅读 · 0 评论 -
动态绑定的关键
In C++, dynamic binding happens when a virtual function is called through a reference (or a pointer) to a base class. The fact that a reference (or pointer) might refer to either a base- or a derived-class object is the key to dynamic binding. Calls to vir原创 2011-02-15 16:21:00 · 365 阅读 · 0 评论