What is the effect of the const keyword in this template?
template <class T, int const ROWNUM, int const COLNUM>
class Matrix
Does it mean that this template only accept a const as parameter? If so, is there a way to pass a variable as the COLNUM and ROWNUM?
(when I try to pass a variable as the COLNUM for the template, it gives an error: “IntelliSense: expression must have a constant value”)
It’s ignored:
The same wording is present at the same location in C++03.
This is partially because template arguments must be known at compile-time anyway. So, whether you have the
constthere or not, you may not pass some variable value: