![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
学习笔记
雷禅
这个作者很懒,什么都没留下…
展开
-
触发动态绑定的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 · 1247 阅读 · 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 · 432 阅读 · 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 · 311 阅读 · 0 评论