template<int _Nx> class _Ph { // placeholder };template<class _Tx> struct is_placeholder { // template to indicate that _Tx is not a placeholder static const int value = 0; };template<int _Nx> struct is_placeholder<_Ph<_Nx> > { // template specialization to indicate that _Ph<_Nx> is a placeholder static const int value = _Nx; };
[解决办法] 主模板 template<class _Tx> struct is_placeholder { // template to indicate that _Tx is not a placeholder static const int value = 0; }; 特化 template<int _Nx> struct is_placeholder<_Ph<_Nx> > { // template specialization to indicate that _Ph<_Nx> is a placeholder static const int value = _Nx; }; [解决办法]