(Partially) specializing a non-type template parameter of dependent type
问题 Maybe I\'m tired, but I\'m stuck with this simple partial specialization, which doesn\'t work because non-type template argument specializes a template parameter with dependent type \'T\' : template <typename T, T N> struct X; template <typename T> struct X <T, 0>; Replacing 0 by T(0) , T{0} or (T)0 doesn\'t help. So is this specialization even possible? 回答1: See paragraph [temp.class.spec] 14.5.5/8 of the standard: The type of a template parameter corresponding to a specialized non-type