- Examples
In this lesson, we'll look at a few examples of template specialization.
We'll cover the following...
We'll cover the following...
Example 1: Template Specialization
Explanation
In the above example, we’re modifying the codes that we have used in the previous lesson.
- Primary template is called when we use values other than
Matrix<data_type, 3, 3>(line 43). - Partial specialization is called when we instantiate
Matrix<data_type, 3, 3>wheredata_typeis notint