这是什么错误以前没见过,要怎么修改!

如图,不是主程序里的错误,弹出了这好像是什么头文件里的东西,这是什么东西,要怎么修改

img

函数重名了,与系统stl带的,你自己改个名字试试

你把main.cpp里代码发出来,应该是和STL里的函数名重名了

你的代码应该和STL的函数名重名了,换个名字再试一下

378和383行代码的函数名确认下,应该声明的有问题

std::iterator_traits模板参数应该是一个迭代器,而你这里却是int类型,你检查一下你使用STL库传入的参数类型是否正确。

首先你要粘贴全的代码才好分析
从你发的错误,
Custom iterator types must either contain member typedefs for difference_type, value_type, pointer, reference, and iterator_category or specialize std::iterator_traits to provide the same.

In your specific case, you should modify your outIterator template like this:

template
class outIterator {
//...
public:
using difference_type = std::ptrdiff_t;
using value_type = T;
using pointer = T*;
using reference = T&;
using iterator_category = std::output_iterator_tag;
//...
};
参考链接
https://stackoverflow.com/questions/59851539/no-type-named-value-type-in-struct-stditerator-traits