- Mastering the C++17 STL
- Arthur O'Dwyer
- 177字
- 2021-07-08 10:20:19
Classical Polymorphism and Generic Programming
The C++ standard library has two distinct, yet equally important, missions. One of these missions is to provide rock-solid implementations of certain concrete data types or functions that have tended to be useful in many different programs, yet aren't built into the core language syntax. This is why the standard library contains std::string, std::regex, std::filesystem::exists, and so on. The other mission of the standard library is to provide rock-solid implementations of widely used abstract algorithms such as sorting, searching, reversing, collating, and so on. In this first chapter, we will nail down exactly what we mean when we say that a particular piece of code is "abstract," and describe the two approaches that the standard library uses to provide abstraction: classical polymorphism and generic programming.
We will look at the following topics in this chapter:
- Concrete (monomorphic) functions, whose behavior is not parameterizable
- Classical polymorphism by means of base classes, virtual member functions, and inheritance
- Generic programming by means of concepts, requirements, and models
- The practical advantages and disadvantages of each approach
- JavaScript百煉成仙
- GraphQL學(xué)習(xí)指南
- 深入淺出WPF
- Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API
- Linux網(wǎng)絡(luò)程序設(shè)計(jì):基于龍芯平臺(tái)
- 深入淺出Android Jetpack
- 前端架構(gòu):從入門(mén)到微前端
- Python Geospatial Development(Second Edition)
- Python機(jī)器學(xué)習(xí)編程與實(shí)戰(zhàn)
- SQL Server 2016數(shù)據(jù)庫(kù)應(yīng)用與開(kāi)發(fā)
- 精通Python自動(dòng)化編程
- 蘋(píng)果的產(chǎn)品設(shè)計(jì)之道:創(chuàng)建優(yōu)秀產(chǎn)品、服務(wù)和用戶體驗(yàn)的七個(gè)原則
- ExtJS Web應(yīng)用程序開(kāi)發(fā)指南第2版
- 30天學(xué)通C#項(xiàng)目案例開(kāi)發(fā)
- Java程序設(shè)計(jì)實(shí)用教程(第2版)