c++面向对象程序设计 笔记五

1.static 

静态和非静态成员

 初始化,  单例模式

2.class template

3.funcation template

4.namespace using

.........


继承,复合,委托

1.composition(复合)

has-a

构造和析构:  构造由内到外 (内部的默认构造函数,编译器添加的版本是调用默认构造)        析构由外到内

 

2.delegation(委托)

即pimpl

 

3.继承 is-a

构造由内而外 先base

析构由外而内 先自己

 

4.虚函数与多态

 

 

 

发布了44 篇原创文章 · 获赞 5 · 访问量 1389

猜你喜欢

转载自blog.csdn.net/qq_33776188/article/details/104732723