# Cpp-Templates-2ed **Repository Path**: windwing007/Cpp-Templates-2ed ## Basic Information - **Project Name**: Cpp-Templates-2ed - **Description**: 📚《C++ Templates 2ed》笔记:C++11/14/17模板技术 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-06-03 - **Last Updated**: 2021-06-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [《C++ Templates》](https://www.safaribooksonline.com/library/view/c-templates-the/9780134778808/)目前有两版,[第一版](https://book.douban.com/subject/1455780/)于2002年11月22日出版,并于2004年出版[中文版](https://book.douban.com/subject/1147909/)。C++11与C++98相比堪称脱胎换骨,模板技术自然也顺应时代变得更为易用,但同时也增加了掌握的负担。为了顺应模板在C++11/14/17中的变化,[第二版](https://book.douban.com/subject/11939436/)于2017年9月25日出版,暂时没有中文版,此为个人阅读英文版的笔记。书中代码见[《C++ Templates 2ed》官方源码](http://www.tmplbook.com/code/code.html)。 ## 相关链接 * GitHub Pages:[https://downdemo.github.io/Cpp-Templates-2ed/](https://downdemo.github.io/Cpp-Templates-2ed/) * GitBook在线阅读:[https://downdemo.gitbook.io/cpp-templates-2ed/](https://downdemo.gitbook.io/cpp-templates-2ed/) ## part1:基础 1. [函数模板(Function Template)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part1%20%E5%9F%BA%E7%A1%80/01%20%E5%87%BD%E6%95%B0%E6%A8%A1%E6%9D%BF.md) 2. [类模板(Class Template)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part1%20%E5%9F%BA%E7%A1%80/02%20%E7%B1%BB%E6%A8%A1%E6%9D%BF.md) 3. [非类型模板参数(Nontype Template Parameter)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part1%20%E5%9F%BA%E7%A1%80/03%20%E9%9D%9E%E7%B1%BB%E5%9E%8B%E6%A8%A1%E6%9D%BF%E5%8F%82%E6%95%B0.md) 4. [可变参数模板(Variadic Template)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part1%20%E5%9F%BA%E7%A1%80/04%20%E5%8F%AF%E5%8F%98%E5%8F%82%E6%95%B0%E6%A8%A1%E6%9D%BF.md) 5. [Tricky Basic](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part1%20%E5%9F%BA%E7%A1%80/05%20Tricky%20Basic.md) 6. [移动语义与enable_if](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part1%20%E5%9F%BA%E7%A1%80/06%20%E7%A7%BB%E5%8A%A8%E8%AF%AD%E4%B9%89%E4%B8%8Eenable_if.md) 7. [按值传递与按引用传递(By Value or by Reference?)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part1%20%E5%9F%BA%E7%A1%80/07%20%E6%8C%89%E5%80%BC%E4%BC%A0%E9%80%92%E4%B8%8E%E6%8C%89%E5%BC%95%E7%94%A8%E4%BC%A0%E9%80%92.md) 8. [编译期编程(Compile-Time Programming)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part1%20%E5%9F%BA%E7%A1%80/08%20%E7%BC%96%E8%AF%91%E6%9C%9F%E7%BC%96%E7%A8%8B.md) 9. [模板实战(Using Templates in Practice)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part1%20%E5%9F%BA%E7%A1%80/09%20%E6%A8%A1%E6%9D%BF%E5%AE%9E%E6%88%98.md) 10. [泛型库(Generic Library)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part1%20%E5%9F%BA%E7%A1%80/10%20%E6%B3%9B%E5%9E%8B%E5%BA%93.md) ## part2:深入模板 11. [深入模板基础(Fundamentals in Depth)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part2%20%E6%B7%B1%E5%85%A5%E6%A8%A1%E6%9D%BF/11%20%E6%B7%B1%E5%85%A5%E6%A8%A1%E6%9D%BF%E5%9F%BA%E7%A1%80.md) 12. [模板中的名称(Names in Template)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part2%20%E6%B7%B1%E5%85%A5%E6%A8%A1%E6%9D%BF/12%20%E6%A8%A1%E6%9D%BF%E4%B8%AD%E7%9A%84%E5%90%8D%E7%A7%B0.md) 13. [实例化(Instantiation)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part2%20%E6%B7%B1%E5%85%A5%E6%A8%A1%E6%9D%BF/13%20%E5%AE%9E%E4%BE%8B%E5%8C%96.md) 14. [模板实参推断(Template Argument Deduction)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part2%20%E6%B7%B1%E5%85%A5%E6%A8%A1%E6%9D%BF/14%20%E6%A8%A1%E6%9D%BF%E5%AE%9E%E5%8F%82%E6%8E%A8%E6%96%AD.md) 15. [特化与重载(Specialization and Overloading)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part2%20%E6%B7%B1%E5%85%A5%E6%A8%A1%E6%9D%BF/15%20%E7%89%B9%E5%8C%96%E4%B8%8E%E9%87%8D%E8%BD%BD.md) ## part3:模板与设计 16. [Traits的实现(Implementing Traits)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part3%20%E6%A8%A1%E6%9D%BF%E4%B8%8E%E8%AE%BE%E8%AE%A1/16%20Traits%E7%9A%84%E5%AE%9E%E7%8E%B0.md) 17. [基于类型属性的重载(Overloading on Type Property)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part3%20%E6%A8%A1%E6%9D%BF%E4%B8%8E%E8%AE%BE%E8%AE%A1/17%20%E5%9F%BA%E4%BA%8E%E7%B1%BB%E5%9E%8B%E5%B1%9E%E6%80%A7%E7%9A%84%E9%87%8D%E8%BD%BD.md) 18. [模板与继承(Template and Inheritance)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part3%20%E6%A8%A1%E6%9D%BF%E4%B8%8E%E8%AE%BE%E8%AE%A1/18%20%E6%A8%A1%E6%9D%BF%E4%B8%8E%E7%BB%A7%E6%89%BF.md) 19. [桥接静态多态与动态多态(Bridging Static and Dynamic Polymorphism)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part3%20%E6%A8%A1%E6%9D%BF%E4%B8%8E%E8%AE%BE%E8%AE%A1/19%20%E6%A1%A5%E6%8E%A5%E9%9D%99%E6%80%81%E5%A4%9A%E6%80%81%E4%B8%8E%E5%8A%A8%E6%80%81%E5%A4%9A%E6%80%81.md) 20. [元编程(Metaprogramming)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part3%20%E6%A8%A1%E6%9D%BF%E4%B8%8E%E8%AE%BE%E8%AE%A1/20%20%E5%85%83%E7%BC%96%E7%A8%8B.md) 21. [Typelist](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part3%20%E6%A8%A1%E6%9D%BF%E4%B8%8E%E8%AE%BE%E8%AE%A1/21%20Typelist.md) 22. [Tuple](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part3%20%E6%A8%A1%E6%9D%BF%E4%B8%8E%E8%AE%BE%E8%AE%A1/22%20Tuple.md) 23. [标签联合(Discriminated Union)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part3%20%E6%A8%A1%E6%9D%BF%E4%B8%8E%E8%AE%BE%E8%AE%A1/23%20%E6%A0%87%E7%AD%BE%E8%81%94%E5%90%88.md) 24. [表达式模板(Expression Template)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part3%20%E6%A8%A1%E6%9D%BF%E4%B8%8E%E8%AE%BE%E8%AE%A1/24%20%E8%A1%A8%E8%BE%BE%E5%BC%8F%E6%A8%A1%E6%9D%BF.md) 25. [模板的调试(Debugging Template)](https://github.com/downdemo/Cpp-Templates-2ed/tree/master/content/Part3%20%E6%A8%A1%E6%9D%BF%E4%B8%8E%E8%AE%BE%E8%AE%A1/25%20%E6%A8%A1%E6%9D%BF%E7%9A%84%E8%B0%83%E8%AF%95.md) ## [原书目录](https://www.safaribooksonline.com/library/view/c-templates-the/9780134778808/) ## part1:基础 1. [函数模板](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch1.xhtml#ch1) 2. [类模板](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch2.xhtml#ch2) 3. [非类型模板参数](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch3.xhtml#ch3) 4. [可变参数模板](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch4.xhtml#ch4) 5. [Tricky Basic](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch5.xhtml#ch5) 6. [移动语义与enable_if](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch6.xhtml#ch6) 7. [按值传递与按引用传递](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch7.xhtml#ch7) 8. [编译期编程](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch8.xhtml#ch8) 9. [模板实战](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch9.xhtml#ch9) 10. [模板术语](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch10.xhtml#ch10) 11. [泛型库](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch11.xhtml#ch11) ## part2:深入模板 12. [深入模板基础](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch12.xhtml#ch12) 13. [模板中的名称](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch13.xhtml#ch13) 14. [实例化](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch14.xhtml#ch14) 15. [模板实参推断](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch15.xhtml#ch15) 16. [特化与重载](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch16.xhtml#ch16) 17. [未来的方向](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch17.xhtml#ch17) ## part3: 模板与设计 18. [模板的多态威力](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch18.xhtml#ch18) 19. [Traits的实现](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch19.xhtml#ch19) 20. [基于类型属性的重载](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch20.xhtml#ch20) 21. [模板与继承](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch21.xhtml#ch21) 22. [桥接静态多态与动态多态](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch22.xhtml#ch22) 23. [元编程](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch23.xhtml#ch23) 24. [Typelist](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch24.xhtml#ch24) 25. [Tuple](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch25.xhtml#ch25) 26. [标签联合](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch26.xhtml#ch26) 27. [表达式模板](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch27.xhtml#ch27) 28. [模板的调试](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/ch28.xhtml#ch28) ## 附录 29. [一处定义原则](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/appa.xhtml#appa) 30. [值类别](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/appb.xhtml#appb) 31. [重载解析](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/appc.xhtml#appc) 32. [标准类型实用程序](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/appd.xhtml#appd) 33. [Concepts](https://learning.oreilly.com/library/view/c-templates-the/9780134778808/appe.xhtml#appe)