C++ Templates: The Complete Guide, 2/e (Hardcover)
暫譯: C++ 模板:完整指南,第二版 (精裝本)

David Vandevoorde, Nicolai M. Josuttis, Douglas Gregor

買這商品的人也買了...

相關主題

商品描述

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 that’s 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 today’s 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.

商品描述(中文翻譯)

模板是 C++ 中最強大的功能之一,但即使隨著 C++ 語言和開發社群的進步,它們仍然被誤解和未充分利用。在《C++ Templates, Second Edition》中,三位開創性的 C++ 專家展示了為什麼、何時以及如何使用現代模板來構建更乾淨、更快速、更高效且更易於維護的軟體。

現在,這本新版本已廣泛更新以符合 C++11、C++14 和 C++17 標準,呈現了適用於更廣泛應用的尖端技術。作者提供了所有新語言特性的權威解釋,這些特性要麼改善模板,要麼與其互動,包括可變參數模板、通用 lambda、類模板參數推導、編譯時 if、轉發引用和用戶定義字面量。他們還深入探討了基本語言概念(如值類別),並全面涵蓋所有標準類型特徵。

本書以對基本概念和相關語言特性的深刻教程開始。其餘部分作為全面的參考,首先專注於語言細節,然後是編碼技術、高級應用和複雜的慣用法。在整個過程中,範例清楚地說明了抽象概念,並展示了利用 C++ 模板所能做的一切的最佳實踐。

- 精確理解模板的行為,避免常見的陷阱
- 使用模板編寫更高效、更靈活且更易於維護的軟體
- 精通當今最有效的慣用法和技術
- 在不妥協性能或安全性的情況下重用源代碼
- 利用 C++ 標準庫中的通用編程工具
- 預覽即將推出的概念功能

《伴隨網站 tmplbook.com 包含範例代碼和其他更新。》