The following is an excerpt of this cppreference page about variable template
When used at class scope, variable template declares a static data member template.
using namespace std::literals; struct matrix_constants { template<class T> using pauli = hermitian_matrix<T, 2>; // alias template template<class T> // static data member template static constexpr pauli<T> sigma1 = { { 0, 1 }, { 1, 0 } }; template<class T> static constexpr pauli<T> sigma2 = { { 0, -1i }, { 1i, 0 } }; template<class T> static constexpr pauli<T> sigma3 = { { 1, 0 }, { 0, -1 } }; };
The C++ Standard (N4140) says the following in paragraph §14.1 (1.4):
A variable template at class scope is a static data member template.
Thus, it seems to me the declarations in the link above don't need the storage-class-specifier static
. Am I correct?
P.S.: I've just started my investigation on templates.