Template Equivalence


Two template class names refer to the same class only if:

Examples

template <class T,unsigned rows,unsigned columns> class matrix;

matrix<double,4,4>   matrixA; // matrixA == 4x4 double matrix
matrix<double,2*2,4> matrixB; // matrixB == 4x4 double matrix
matrix<double,5,4>   matrixC; // matrixC == 5x4 double matrix
matrix<complex,4,4>  matrixD; // matrixD == 4x4 complex matrix

Clearly, the instances matrixA and matrixB are of the same type - their template parameter lists have only superficial differences. The type of matrixC differs from that of matrixA and matrixB because one of the constant expressions specified for the template parameter list differs from that specified for the previous two declarations. The type of matrixD differs from the previous three declarations because complex is used instead of double.