An Introduction to C++ Templates
(Page 1 of 3 )
Do you feel as though a subset of functions within a class are preforming the same tasks, and only differ by datatype? The power of C++ templates is that they allow alogorithms to be abstracted from their data types. Read more ...
Understanding the fundamentals of templates in C++ is something that few users of the language can afford to do without. However, those wishing to explore the more advanced features often find themselves struggling with a lack of clear explanation into exactly how templates are supported by the language. A frustrating problem when working with templates is that some vendors implement a subset of the C++ standard. This column will point out common pitfalls and provide an insight into how to produce fast, reusable, and efficient code using C++ templates.
A testament to the power of templates is that entire libraries have been written as a set of template classes, most notably STL and ATL. The standard C++ library provides a wealth of reusable and flexible classes and algorithms, while ATL is the de facto standard for COM programming in C++. To master these and other template libraries, it is important to have more than a basic understanding of how templates work.
Next: C Templates >>
More C++ Articles
More By Kais Dukes