Advanced Metaprogramming in Classic C++ (Paperback)

Davide Di Gennaro

  • 出版商: Apress
  • 出版日期: 2015-04-30
  • 售價: $3,300
  • 貴賓價: 9.5$3,135
  • 語言: 英文
  • 頁數: 572
  • 裝訂: Paperback
  • ISBN: 1484210115
  • ISBN-13: 9781484210116
  • 相關分類: C++ 程式語言
  • 海外代購書籍(需單獨結帳)

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

商品描述

Advanced Metaprogramming in Classic C++: Third Edition, offers a detailed and somewhat intense look into template metaprogramming (TMP) using Classic C++ code examples. The two newer standards are not used in the code so that the examples can be rich, illustrate the point, and be run with confidence. The code can be readily adapted to include the elements of the Modern C++ standards. The gain for the reader is that TMP is presented in the book as a set of techniques that will enable a new style to your C++ coding while making it exceptionally clear and efficient.

The book deals with language aspects, design patterns, examples and applications (seen as case studies). Special emphasis is put on small reusable techniques that will improve the quality of daily work. This is a book to sit with and learn from. Users of it in prior editions point out that they come back to it over and over. This edition enhances the readability and clarity of the discussion.

The approach in the book is used to maximize compatibility and clearly illustrate the techniques, enabling the reader to comprehend difficult material without the burdens of compiler errors, and other unnecessary complexities and enabling a much more intense treatment of the subject. For those interested in Modern C++, all subsequent additions to the C++ language are fully compatible with the code in this book and users familiar with them can leverage the techniques introduced in C++XX to make the patterns in this book even more powerful. There is a chapter that discusses issues regarding the two newer standards and the basics needed to program for the newer standards are readily available online.

What makes the book exceptional is the level of understanding of the concepts involved imparted by the author. This is not just a rote overview of metaprogramming. You will truly understand difficult topics like static assertions, how to write metafunctions, overload resolution, lambda expressions, and many others. More than that, you will work through them with practical examples guided by the author's frank explanations. This book requires you to think and to learn and to understand the language so that you can program at a higher level.

What you’ll learn

  • What templates and the small object toolkit are, and how to use them
  • How to do overload resolution
  • How to do metaprogramming with interfaces, algorithms, functors and refactoring
  • How to work with code generators
  • What is opaque type principle and how to use it
  • How to work with debugging templates and more
  • A chapter devoted to issues surrounding C++0x and C++14

Who this book is for

This book is for experienced C++ programmers who want to learn more.

Table of Contents

Part I

1. Templates

2. Small Object Toolkit

Part II

3. Static Programming

4. Overload Resolution

5. Interfaces

6. Algorithms

7. Code Generators

8. Functors

9. Opaque Type Principle

Part III

10. Refactoring

11. Debugging Templates

12. C++0X

13. Appendix A: Exercises

14. Appendix B: Bibliography

商品描述(中文翻譯)

《Classic C++中的高級元程式設計:第三版》提供了詳細且相當深入的模板元程式設計(TMP)的介紹,並使用Classic C++的程式碼示例。為了使示例豐富、說明明確且能夠自信地運行,書中未使用較新的兩個標準。這些程式碼可以輕鬆地適應現代C++標準的元素。讀者的收穫在於,本書將TMP作為一組技術呈現,這些技術將使您的C++編碼風格更加清晰高效。

本書涵蓋了語言方面、設計模式、示例和應用(視為案例研究)。特別強調了一些小型可重用技術,這些技術將提高日常工作的質量。這是一本需要細心閱讀和學習的書籍。之前版本的使用者指出,他們一遍又一遍地回頭翻閱這本書。本版增強了討論的可讀性和清晰度。

本書的方法旨在最大程度地提高兼容性並清晰地展示技術,使讀者能夠理解困難的內容,而不必擔心編譯器錯誤和其他不必要的複雜性,並能更深入地研究該主題。對於那些對現代C++感興趣的人來說,C++語言的所有後續添加都與本書中的代碼完全兼容,熟悉這些添加的用戶可以利用C++XX中介紹的技術使本書中的模式更加強大。書中還有一章討論了與兩個較新標準相關的問題,並且在線上可以輕鬆找到為新標準編程所需的基礎知識。

使本書與眾不同的是作者對所涉及概念的理解程度。這不僅僅是對元程式設計的機械概述。您將真正理解像靜態斷言、如何編寫元函數、重載解析、lambda表達式等困難主題。不僅如此,您還將通過作者坦率的解釋在實際示例中進行實踐。本書需要您思考、學習和理解語言,以便能夠在更高的層次上進行編程。

您將學到什麼:
- 什麼是模板和小型物件工具包,以及如何使用它們
- 如何進行重載解析
- 如何使用接口、算法、函子和重構進行元程式設計
- 如何使用代碼生成器
- 什麼是不透明類型原則以及如何使用它
- 如何使用調試模板等等
- 一章專門討論C++0x和C++14相關問題

本書適合有經驗的C++程序員,他們想要學習更多。目錄如下:
- 第一部分
1. 模板
2. 小型物件工具包

- 第二部分
3. 靜態編程
4. 重載解析
5. 接口
6. 算法
7. 代碼生成器
8. 函子
9. 不透明類型原則

- 第三部分
10. 重構
11. 調試模板
12. C++0X
13. 附錄A:練習
14. 附錄B:參考文獻