Cpp Templates 2ed Save

C++11/14/17/20 templates and generic programming, the most complex and difficult technical details of C++, indispensable in building infrastructure libraries.

Project README
  • C++ 模板技术是泛型编程的核心,但囿于编译器技术限制,不得不带着缺陷诞生,语法晦涩,报错冗长,难以调试,应用层开发较少使用,相关技术书籍匮乏,因此掌握难度较大。模板相关的经典技术书籍主要有三本,分别是 2001 年出版的 Modern C++ Design、2002 年出版的 C++ Templates、2004 年出版的 C++ Template Metaprogramming。三者基于的 C++ 标准都是 C++98,Modern C++ Design 涉及 Andrei Alexandrescu 写书时配套的 LokiC++ Template Metaprogramming 涉及 Boost,二者以介绍元编程(模板技术的一种应用)为主,只有 C++ Templates 主要介绍 C++98 标准的模板技术。时过境迁,C++ 标准的更新逐步修复了一些语法缺陷,减少了使用者的心智负担,并引入了语法糖和工具,让编写模板越来越简单。2017 年 9 月 25 日,基于 C++17 标准,C++ Templates 2ed 出版,填补了十多年间模板技术进化时相关书籍的空白,堪称最全面的模板教程,也是对 C++11/14/17 特性介绍最为全面的书籍之一。个人完整学习原书后,梳理精简章节脉络,补充 C++20 相关特性,如 concepts、支持模板参数的 lambda 等,运行验证所有代码结果,最终记录至此。

Contents

  1. Function template
  2. Class template
  3. Non-type template parameter
  4. Variadic template
  5. Move semantics and perfect forwarding
  6. Name lookup
  7. Instantiation
  8. Template argument deduction
  9. Specialization and overloading
  10. Traits
  11. Inheritance
  12. Type erasure
  13. Metaprogramming
  14. Expression template
  15. Debugging
Open Source Agenda is not affiliated with "Cpp Templates 2ed" Project. README Source: downdemo/Cpp-Templates-2ed
Stars
1,577
Open Issues
0
Last Commit
8 months ago
License

Open Source Agenda Badge

Open Source Agenda Rating