Notes

Private inheritance means is-implemented-in-terms-of.there is no conceptual relationship between objects of types B and D,private inheritance is purely an implementation technique.

Public inheritance means "is a"

application domain:has a

implementation domain:artifacts,like buffers,mutex,search trees and so forth


four conditions that nontrivial default constructor  of the class is syntheized

1.Member Class Object with Default Constutor

2.Base Class with Default Constructor

3.class with a virtual function

The class either declares (or inherits) a virtual function
The class is derived from an inheritance chain in which one or more base classes are virtual

augmentations to do 

A virtual function table (referred to as the class vtbl in the original cfront implementation) is
generated and populated with the addresses of the active virtual functions for that class.
 Within each class object, an additional pointer member (the vptr) is synthesized to hold the
address of the associated class vtbl.

4.Class with a Virtual Base Class

There are four characteristics of a class under which the compiler needs to synthesize a default
constructor for classes that declare no constructor at all. The Standard refers to these as implicit,
nontrivial default constructors. The synthesized constructor fulfills only an implementation need. It
does this by invoking member object or base class default constructors or initializing the virtual
function or virtual base class mechanism for each object

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值