Advanced  Metaprogramming in Classic C++ [electronic resource] /
Di Gennaro, Davide.author.
Advanced Metaprogramming in Classic C++ aims to be both an introduction and a reference to C++ template metaprogramming (TMP); TMP is presented in the book as a set of techniques that will bring a new style in C++ and make code 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. 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.
Description based upon print version of record.
Contents at a Glance; PART 1: #include ; Chapter 1: Templates; 1.1. C++ Templates; 1.1.1. Typename; 1.1.2. Angle Brackets; 1.1.3. Universal Constructors; 1.1.4. Function Types and Function Pointers; 1.1.5. Non-Template Base Classes; 1.1.6. Template Position; 1.2. Specialization and Argument Deduction; 1.2.1. Deduction; 1.2.2. Specializations; 1.2.3. Inner Class Templates; 1.3. Style Conventions; 1.3.1. Comments; 1.3.2. Macros; 1.3.3. Symbols; 1.3.4. Generality; 1.3.5. Template Parameters; 1.3.6. Metafunctions; 1.3.7. Namespaces and Using Declarations; 1.4. Classic Patterns
1.4.1. size_t and ptrdiff_t1.4.2. void T::swap(T&); 1.4.3. bool T::empty() const ;  void T::clear(); 1.4.4. X T::get() const ;  X T::base() const; 1.4.5. X T::property() const ;  void T::property(X); 1.4.6. Action(Value) ;  Action(Range); 1.4.7. Manipulators; 1.4.8. Position of Operators; 1.4.9. Secret Inheritance; 1.4.10. Literal Zero; 1.4.11. Boolean Type; 1.4.12. Default and Value Initialization; 1.5. Code Safety; 1.6. Compiler Assumptions; 1.6.1. Inline; 1.6.2. Error Messages; Long Template Stack; Implementation Details; Expanded Typedefs; Incomplete Types; 1.6.3. Miscellaneous Tips
Don't Blame the CompilerKeep Warnings at the Default Level; Do Not Silence Warnings with "Dirty" Code Modifications; Maintain a Catalog of Compiler Bugs; Avoid Non-Standard Behavior; Don't Be Afraid of Language Features; Think About What Users of Your Code Would Do; 1.7. Preprocessor; 1.7.1. Include Guards; 1.7.2. Macro Expansion Rules; Chapter 2: Small Object Toolkit; 2.1. Hollow Types; 2 .1.1. instance_of; 2.1.2. Selector; 2.1.3. Static Value; 2.1.4. Size of Constraints; 2.2. Static Assertions; 2.2.1. Boolean Assertions; 2.2.2. Assert Legal; 2.2.3. Assertions with Overloaded Operators
2.2.4. Modeling Concepts with Function Pointers2.2.5. Not Implemented; 2.3. Tagging Techniques; 2.3.1. Type Tags; 2.3.2. Tagging with Functions; 2 .3.3. Tag Iteration; 2 .3.4. Tags and Inheritance; PART 2: #include ; Chapter 3: Static Programming; 3.1. Static Programming with the Preprocessor; 3.2. Compilation Complexity; 3.3. Classic Metaprogramming Idioms; 3.3.1. Static Short Circuit; 3.4. Hidden Template Parameters; 3 .4.1. Static Recursion on Hidden Parameters; 3.4.2. Accessing the Primary Template; 3.4.3. Disambiguation; 3.5. Traits; 3.5.1. Type Traits
3.5.2. Type Dismantling3.6. Type Containers; 3.6.1. typeat; 3.6.2. Returning an Error; 3.6.3. Depth; 3.6.4. Front and Back; 3.6.5. Find; 3.6.6. Push and Pop; 3.6.7 . More on Template Rotation; 3.6.8. Agglomerates; 3.6.9 . Conversions; 3.6.10. Metafunctors; 3.7. A Summary of Styles; Chapter 4: Overload Resolution; 4.1. Groups; 4.1.1. From Overload to Groups; 4.1.2. Runtime Decay; 4.2. More Traits; 4.2.1. A Function Set for Strings; 4.2.2. Concept Traits; 4.2.3. Platform-Specific Traits; 4.2.4. Merging Traits; 4.3. SFINAE; 4.3. 1. SFINAE Metafunctions; 4.3.2. Multiple Decisions; 4.3.3. Only_If
4.3.4. SFINAE and Returned Functors
Includes bibliographical references and index.
Advanced Metaprogramming in Classic C++ aims to be both an introduction and a reference to C++ template metaprogramming (TMP); TMP is presented in the book as a set of techniques that will bring a new style in C++ and make code 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. 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.
Programming languages (Electronic computers).
Programming Languages, Compilers, Interpreters.