美文网首页
ostream_iterator

ostream_iterator

作者: Then丶 | 来源:发表于2020-04-05 15:00 被阅读0次
ostream_iterator<int> out_iter(cout, " ");
for(auto e : vec)
  *out_iter++ = e;
cout << endl;
  • 可以写为
for(auto e : vec)
  out_iter = e;
cout << endl;
copy(vec.begin, vec.end(), out_iter);

相关文章

网友评论

      本文标题:ostream_iterator

      本文链接:https://www.haomeiwen.com/subject/bxuuphtx.html