当前位置: 代码迷 >> 综合 >> 编译器报错 [Error] request for member ‘Traverse‘ in ‘l4‘, which is of non-class type ‘int‘
  详细解决方案

编译器报错 [Error] request for member ‘Traverse‘ in ‘l4‘, which is of non-class type ‘int‘

热度:66   发布时间:2023-11-27 07:55:40.0

编译器报错[Error] request for member 'Traverse' in 'l4', which is of non-class type 'int'是因为使用的是函数模板,使用函数和定义X类的数据时需要在<>里声明数据类型

例如SqList<> l2(10),l3(10),l4(10);就会报错

SqList是定义的类,要开3个数组l1l2l3

修改后是

SqList<int> l2(10),l3(10),l4(10);

  相关解决方案