Function Template

  1. template <typename T>
  2. The keywords template and typename are obligatory.
  3. The template does not create any functions. Instead, it provides the compiler with directions about how to define a function.
  4. The compiler checks the argument types you use and then generates the corresponding function.
  5. A function template is a generic function description.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章