C++ Templates: The Complete Guide (2nd Edition)

C++ Templates: The Complete Guide (2nd Edition)
复制标题

C 模板:完整指南(第二版)

DOI:
--
复制
发表时间:
2017
期刊:
影响因子:
--
通讯作者:
Douglas P. Gregor
Douglas P. Gregor
中科院分区:
--
文献类型:
--
作者:
D. Vandevoorde;Nicolai M. Josuttis;Douglas P. Gregor

文献摘要

被引文献

相似文献

模板是c++最强大的特性之一,但是即使c++语言和开发社区已经取得了进步,它们仍然被误解和未充分利用。在《c++模板第二版》中,三位c++先驱专家展示了为什么、何时以及如何使用现代模板来构建更干净、更快、更高效、更易于维护的软件。现在广泛更新了c++ 11、c++ 14和c++ 17标准,这个新版本为更广泛的应用程序提供了最先进的技术。作者对所有改进模板或与模板交互的新语言特性提供了权威的解释,包括可变模板、泛型lambdas、类模板参数演绎、编译时if、转发引用和用户定义的文字。它们还深入研究了基本的语言概念(如值类别),并完全涵盖了所有标准类型特征。这本书从一个关于基本概念和相关语言特性的有见地的教程开始。本书的其余部分作为一个全面的参考,首先侧重于语言细节,然后是编码技术,高级应用程序和复杂的习语。在整个过程中,示例清楚地说明了抽象概念,并演示了利用c++模板所能做的一切的最佳实践。准确地理解模板的行为,避免常见的陷阱使用模板编写更高效、灵活和可维护的软件掌握当今最有效的习惯用法和技术重用源代码而不影响性能或安全受益于c++标准库中的泛型编程实用程序预览即将到来的概念功能的伙伴网站,tmplbook.com,包含示例代码和其他更新。
Templates are among the most powerful features of C++, but they remain misunderstood and underutilized, even as the C++ language and development community have advanced. In C++ Templates, Second Edition, three pioneering C++ experts show why, when, and how to use modern templates to build software thats cleaner, faster, more efficient, and easier to maintain. Now extensively updated for the C++11, C++14, and C++17 standards, this new edition presents state-of-the-art techniques for a wider spectrum of applications. The authors provide authoritative explanations of all new language features that either improve templates or interact with them, including variadic templates, generic lambdas, class template argument deduction, compile-time if, forwarding references, and user-defined literals. They also deeply delve into fundamental language concepts (like value categories) and fully cover all standard type traits. The book starts with an insightful tutorial on basic concepts and relevant language features. The remainder of the book serves as a comprehensive reference, focusing first on language details and then on coding techniques, advanced applications, and sophisticated idioms. Throughout, examples clearly illustrate abstract concepts and demonstrate best practices for exploiting all that C++ templates can do. Understand exactly how templates behave, and avoid common pitfalls Use templates to write more efficient, flexible, and maintainable software Master todays most effective idioms and techniques Reuse source code without compromising performance or safety Benefit from utilities for generic programming in the C++ Standard Library Preview the upcoming concepts feature The companion website, tmplbook.com, contains sample code and additional updates.