Game Development Reference
In-Depth Information
Part 4
Generic Programming
Although the STL provides a ready-made library of templates to cover many requirements, there is
no escaping the fact that you will eventually need to use the ability to create your own templates.
The C++ template compiler is a complex, underused, and exceptionally useful piece of software.
As well as letting you abstract types out of your classes to create generic and reusable code, the
template compiler can also let you calculate constant values at compile time. This type of template
programming is known as template metaprogramming.
This part of the topic introduces you to the features C++ provides to create your own templates.
It also shows you how to use some built-in template metaprograms and even ends with an example
of how you can create your own template metaprogram.
 
Search WWH ::




Custom Search