Template Metaprogramming with C++: Learn everything about C++ templates and unlock the power of template metaprogramming (Paperback)
暫譯: C++ 模板元編程:學習 C++ 模板的所有知識,解鎖模板元編程的力量 (平裝本)
Bancila, Marius
- 出版商: Packt Publishing
- 出版日期: 2022-08-19
- 售價: $1,900
- 貴賓價: 9.5 折 $1,805
- 語言: 英文
- 頁數: 480
- 裝訂: Quality Paper - also called trade paper
- ISBN: 1803243457
- ISBN-13: 9781803243450
-
相關分類:
C++ 程式語言
立即出貨 (庫存=1)
買這商品的人也買了...
-
$1,188Fedora 11 and Red Hat Enterprise Linux Bible (Paperback)
-
$800$632 -
$360$281 -
$3,743Financial Signal Processing and Machine Learning
-
$520$411 -
$650$507 -
$650$514 -
$3,600$3,420 -
$720$612 -
$450$351 -
$560$442 -
$594$564 -
$500$395 -
$1,750$1,663 -
$600$468 -
$680$537 -
$1,200$948 -
$680$537 -
$2,500$2,375 -
$780$608 -
$600$468 -
$680$537 -
$580$458 -
$509邊緣計算及其資源管理技術
-
$680$530
商品描述
Understand how to use modern C++ templates for writing maintainable, robust, and fast software
Key Features
- Grasp the fundamentals of and learn to write effective C++ templates
- Get up to speed with the latest C++20 template features such as constraints and concepts
- Explore different patterns and idioms to integrate templates in your program design
Book Description
Learn how the metaprogramming technique enables you to create data structures and functions that allow computation to happen at compile time. With this book, you'll realize how templates help you avoid writing duplicate code and are key to creating generic libraries, such as the standard library or Boost, that can be used in a multitude of programs.
The introductory chapters of this book will give you insights into the fundamentals of templates and metaprogramming. You'll then move on to practice writing complex templates and exploring advanced concepts such as template recursion, template argument deduction, forwarding references, type traits, and conditional compilation. Along the way, you'll learn how to write variadic templates and how to provide requirements to the template arguments with C++20 constraints and concepts. Finally, you'll apply your knowledge of C++ metaprogramming templates to implement various metaprogramming patterns and techniques.
By the end of this book, you'll have learned how to write effective templates and implement metaprogramming in your everyday programming journey.
What you will learn
- Understand the syntax for all types of templates
- Discover how specialization and instantiation works
- Get to grips with template argument deduction and forwarding references
- Write variadic templates with ease
- Become familiar with type traits and conditional compilation
- Restrict template arguments in C++20 with constraints and concepts
- Implement patterns such as CRTP, mixins, and tag dispatching
Who this book is for
This book is for beginner-to-intermediate C++ developers who want to learn about template metaprogramming as well as advanced C++ developers looking to get up to speed with the new C++20 features related to templates and the the various idioms and patterns. Basic C++ coding experience is necessary to get started with this book.
商品描述(中文翻譯)
了解如何使用現代 C++ 模板來編寫可維護、穩健且快速的軟體
主要特點
- 掌握 C++ 模板的基本原理並學會編寫有效的 C++ 模板
- 熟悉最新的 C++20 模板特性,如約束(constraints)和概念(concepts)
- 探索不同的模式和慣用法,以將模板整合到您的程式設計中
書籍描述
了解元編程技術如何使您能夠創建數據結構和函數,允許在編譯時進行計算。通過本書,您將意識到模板如何幫助您避免編寫重複的代碼,並且是創建通用庫(如標準庫或 Boost)的關鍵,這些庫可以在多個程式中使用。
本書的入門章節將為您提供模板和元編程的基本概念。然後,您將練習編寫複雜的模板,並探索高級概念,如模板遞歸、模板參數推導、轉發引用、類型特徵和條件編譯。在此過程中,您將學會如何輕鬆編寫可變參數模板,並如何使用 C++20 的約束和概念為模板參數提供要求。最後,您將應用 C++ 元編程模板的知識來實現各種元編程模式和技術。
到本書結束時,您將學會如何編寫有效的模板並在日常編程中實現元編程。
您將學到的內容
- 理解各類模板的語法
- 發現專門化和實例化的工作原理
- 熟悉模板參數推導和轉發引用
- 輕鬆編寫可變參數模板
- 熟悉類型特徵和條件編譯
- 使用 C++20 的約束和概念限制模板參數
- 實現如 CRTP、混合類(mixins)和標籤調度(tag dispatching)等模式
本書適合對象
本書適合初學者到中級的 C++ 開發者,想要學習模板元編程的內容,以及希望熟悉與模板相關的新 C++20 特性和各種慣用法及模式的高級 C++ 開發者。開始閱讀本書需要具備基本的 C++ 編程經驗。
目錄大綱
1. Introduction to Templates
2. Template Fundamentals
3. Variadic Templates
4. Advanced Template Concepts
5. Type Traits and Conditional Compilation
6. Concepts and Constraints
7. Patterns and Idioms
8. Ranges and Algorithms
9. The Ranges Library
10. Appendix
目錄大綱(中文翻譯)
1. Introduction to Templates
2. Template Fundamentals
3. Variadic Templates
4. Advanced Template Concepts
5. Type Traits and Conditional Compilation
6. Concepts and Constraints
7. Patterns and Idioms
8. Ranges and Algorithms
9. The Ranges Library
10. Appendix