Yes you can. Just put your template parameter on top of the class instead of where the member declaration is like so:
template <uint64_t N>
class Table
{
public:
Table() // LINE 45
{
// The constant 'N' in the template definitions
// No need for an external variable
}
void AddRow(const std::array<std::wstring, N> & NewRow)
{
Rows.push_back(NewRow);
}
private:
// Not here
std::list<std::array<std::wstring, N>> Rows;
};
then to use it you just do Table<5> stuff;
This would make it a compile time constant. Your code doesn't work because you can't have template parameters for individual members as they have to be in the class declaration instead.