- 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.
推薦閱讀
- HornetQ Messaging Developer’s Guide
- FuelPHP Application Development Blueprints
- Python數據可視化:基于Bokeh的可視化繪圖
- Python數據分析基礎
- 騰訊iOS測試實踐
- 面向對象程序設計(Java版)
- jQuery開發基礎教程
- “笨辦法”學C語言
- JavaScript應用開發實踐指南
- 跟戴銘學iOS編程:理順核心知識點
- 石墨烯改性塑料
- Java面試一戰到底(基礎卷)
- Getting Started with Hazelcast
- SQL Server 2008數據庫應用技術(第2版)
- Jenkins 2.x Continuous Integration Cookbook(Third Edition)