官术网_书友最值得收藏!

Summary

In this chapter, we discussed the fundamental concepts of object-oriented programming. We touched on the low-level details of classes and the compiler implementation of the C++ object model. Knowing how to design and implement classes without actually having classes helps a lot in using the classes the right way.

We also discussed the need for inheritance and tried to employ composition instead of inheritance wherever it might be applicable. C++ supports three types of inheritance: public, private, and protected. All of these types have their applications in particular class designs. Finally, we understood the use and power of polymorphism by bringing an example that drastically increases the convenience of the client code.

In the next chapter, we will learn more about templates and template metaprogramming, which we will use as the basis to dive into a new C++20 feature called concepts.

主站蜘蛛池模板: 青州市| 盐池县| 来宾市| 大足县| 宜宾市| 日照市| 额济纳旗| 中西区| 岗巴县| 宜城市| 旅游| 四会市| 朝阳区| 阳东县| 汉阴县| 颍上县| 徐闻县| 阿拉善右旗| 城市| 昆山市| 崇义县| 内江市| 武强县| 介休市| 铜陵市| 友谊县| 铜鼓县| 弋阳县| 晋江市| 龙泉市| 固镇县| 靖西县| 衡阳市| 漠河县| 华池县| 正宁县| 石泉县| 永福县| 舟山市| 永和县| 中卫市|