Skip to content

C++ Templates The Complete Guide

Best in textbook rentals since 2012!

ISBN-10: 0201734842

ISBN-13: 9780201734843

Edition: 2003

Authors: David Vandevoorde, Nicolai M. Josuttis

List price: $79.99
Blue ribbon 30 day, 100% satisfaction guarantee!
what's this?
Rush Rewards U
Members Receive:
Carrot Coin icon
XP icon
You have reached 400 XP and carrot coins. That is the daily max!

Description:

This book will be the next C++ classic. Although templates have been part of C++ for well over a decade, they still lead to misunderstanding, misuse, and controversy. At the same time, they are increasingly found to be powerful instruments for the development of cleaner, faster, and smarter software. This has made templates one of the hottest topics in the C++ community. This book will be both a complete reference as well as a tutorial. It will emphasize the practical use of templates, and will include real-world examples. Every working C++ programmer will need a copy of this book for his or her library.
Customers also bought

Book details

List price: $79.99
Copyright year: 2003
Publisher: Addison Wesley Professional
Publication date: 11/12/2002
Binding: Hardcover
Pages: 560
Size: 7.50" wide x 9.25" long x 1.25" tall
Weight: 2.244
Language: English

Preface
Acknowledgments
About This Book
What You Should Know Before Reading This Book
Overall Structure of the Book
How to Read This Book
Some Remarks About Programming Style
The Standard versus Reality
Example Code and Additional Informations
Feedback
The Basics
Function Templates
A First Look at Function Templates
Argument Deduction
Template Parameters
Overloading Function Templates
Summary
Class Templates
Implementation of Class Template Stack
Use of Class Template Stack
Specializations of Class Templates
Partial Specialization
Default Template Arguments
Summary
Nontype Template Parameters
Nontype Class Template Parameters
Nontype Function Template Parameters
Restrictions for Nontype Template Parameters
Summary
Tricky Basics
Keyword typename
Using this->
Member Templates
Template Template Parameters
Zero Initialization
Using String Literals as Arguments for Function Templates
Summary
Using Templates in Practice
The Inclusion Model
Explicit Instantiation
The Separation Model
Templates and inline
Precompiled Headers
Debugging Templates
Afternotes
Summary
Basic Template Terminology
"Class Template" or "Template Class"?
Instantiation and Specialization
Declarations versus Definitions
The One-Definition Rule
Template Arguments versus Template Parameters
Templates in Depth
Fundamentals in Depth
Parameterized Declarations
Template Parameters
Template Arguments
Friends
Afternotes
Names in Templates
Name Taxonomy
Looking Up Names
Parsing Templates
Derivation and Class Templates
Afternotes
Instantiation
On-Demand Instantiation
Lazy Instantiation
The C++ Instantiation Model
Implementation Schemes
Explicit Instantiation
Afternotes
Template Argument Deduction
The Deduction Process
Deduced Contexts
Special Deduction Situations
Allowable Argument Conversions
Class Template Parameters
Default Call Arguments
The Barton-Nackman Trick
Afternotes
Specialization and Overloading
When "Generic Code" Doesn't Quite Cut It
Overloading Function Templates
Explicit Specialization
Partial Class Template Specialization
Afternotes
Future Directions
The Angle Bracket Hack
Relaxed typename Rules
Default Function Template Arguments
String Literal and Floating-Point Template Arguments
Relaxed Matching of Template Template Parameters
Typedef Templates
Partial Specialization of Function Templates
The typeof Operator
Named Template Arguments
Static Properties
Custom Instantiation Diagnostics
Overloaded Class Templates
List Parameters
Layout Control
Initializer Deduction
Function Expressions
Afternotes
Templates and Design
The Polymorphic Power of Templates
Dynamic Polymorphism
Static Polymorphism
Dynamic versus Static Polymorphism
New Forms of Design Patterns
Generic Programming
Afternotes
Traits and Policy Classes
An Example: Accumulating a Sequence
Type Functions
Policy Traits
Afternotes
Templates and Inheritance
Named Template Arguments
The Empty Base Class Optimization (EBCO)
The Curiously Recurring Template Pattern (CRTP)
Parameterized Virtuality
Afternotes
Metaprograms
A First Example of a Metaprogram
Enumeration Values versus Static Constants
A Second Example: Computing the Square Root
Using Induction Variables
Computational Completeness
Recursive Instantiation versus Recursive Template Arguments
Using Metaprograms to Unroll Loops
Afternotes
Expression Templates
Temporaries and Split Loops
Encoding Expressions in Template Arguments
Performance and Limitations of Expression Templates
Afternotes
Advanced Applications
Type Classification
Determining Fundamental Types
Determining Compound Types
Identifying Function Types
Enumeration Classification with Overload Resolution
Determining Class Types
Putting It All Together
Afternotes
Smart Pointers
Holders and Trules
Reference Counting
Afternotes
Tuples
Duos
Recursive Duos
Tuple Construction
Afternotes
Function Objects and Callbacks
Direct, Indirect, and Inline Calls
Pointers and References to Functions
Pointer-to-Member Functions
Class Type Functors
Specifying Functors
Introspection
Function Object Composition
Value Binders
Functor Operations: A Complete Implementation
Afternotes
Appendixes
The One-Definition Rule
Translation Units
Declarations and Definitions
The One-Definition Rule in Detail
Overload Resolution
When Does Overload Resolution Kick In?
Simplified Overload Resolution
Overloading Details
Bibliography
Newsgroups
Books and Web Sites
Glossary
Index