对于代码,为什么错误,osteam_iterator是一个模板类,为什么没有匹配的构造函数来初始化'ostream_iterator',请帮忙,谢谢。定义 ostream_iterator 模板 > 类 _LIBCPP_VISIBLE ostream_iterator
int main(int argc, const char * argv[])
{
vector<int> sentence1;
sentence1.reserve(5);// 设置每次分配内存的大小
sentence1.push_back(1);
sentence1.push_back(2);
sentence1.push_back(3);
sentence1.push_back(4);
sentence1.push_back(5);
int c = 5;
copy(sentence1.begin(), sentence1.end(), ostream_iterator<int>(cout, 1));
cout << endl;