## 22.5 Nontype Template Arguments (cont.)

- Compatibility checked at compile time

  > `Matrix<int, 3, 4> a;
  > Matrix<double, 3, 4> b;
  > Matrix<int, 5, 7> c;
  > Matrix<int, 3, 4> d;
  > b = a; // Error, element types don't match.
  > c = a; // Error, sizes dont match, so types differ.
  > d = a; // OK. Element types and sizes match.`

- The requirements for matrix multiplication are much more difficult to specify

prev |top |next