当前位置: 代码迷 >> 综合 >> 报错类型 template error: shadows template parm
  详细解决方案

报错类型 template error: shadows template parm

热度:85   发布时间:2023-12-08 20:39:25.0

使用模板时,不能在嵌套作用域中用相同的名称声明模板参数

//Error
template<class T> 
class linklist
{
    template<class T>   //错误class node{
    }
}//Correct
template<class T> 
class linklist
{
    template<class U> class node{
    	}
}
  相关解决方案