Template Specializations and Meta Programming
Explore template specializations and meta programming.
We'll cover the following...
Template specializations
We have discussed template specializations in the templates chapter. Like type parameters, other kinds of template parameters can also be specialized. The following is the general definition of a template and its specialization for 0:
Press + to interact
void foo(int value)() {// ... general definition ...}void foo(int value : 0)() {// ... special definition for zero ...}
We will take advantage of template specializations in the meta programming section below.