- Expert C++
- Vardan Grigoryan Shunguang Wu
- 141字
- 2021-06-24 16:34:05
Function templates
A function template defines how a family of functions can be generated. A family here means a group of functions that behave similarly. As shown in the following diagram, this includes two phases:
- Creating a function template; that is, the rules on how to write it.
- Template instantiation; that is, the rules that are used to generate functions from their template:
Function template format
In part I of the preceding diagram, we discuss the format that will be used to create a function template for generic types, but with respect to the specialized template, which we also refer to as the primary template. Then, in part II, we introduce the three ways to generate functions from the template. Lastly, the specialization and overloading subsection tells us how to customize the primary template (by changing its behavior) for special types.
推薦閱讀
- 摩登創(chuàng)客:與智能手機和平板電腦共舞
- SpringMVC+MyBatis快速開發(fā)與項目實戰(zhàn)
- Vue.js快跑:構(gòu)建觸手可及的高性能Web應用
- TradeStation交易應用實踐:量化方法構(gòu)建贏家策略(原書第2版)
- Mastering Ext JS
- Learning OpenStack Networking(Neutron)
- 計算機應用基礎實踐教程
- Python全棧數(shù)據(jù)工程師養(yǎng)成攻略(視頻講解版)
- Java圖像處理:基于OpenCV與JVM
- 深度學習程序設計實戰(zhàn)
- Software Development on the SAP HANA Platform
- Selenium WebDriver Practical Guide
- Solr權(quán)威指南(下卷)
- Isomorphic JavaScript Web Development
- Scratch 3.0少兒積木式編程(6~10歲)