2013年10月18日

迭代器之输入和输出迭代器

摘要: 输入迭代器:只能前向读取的迭代器,支持++,不能--输出迭代器:只能前向写入的迭代器,支持++,不能--这两种迭代器最简单,基本只能读取/写入一次例子:#include #include #include #include using namespace std;template void print_range(Iter begin, Iter end){ // 输出 copy(begin, end, ostream_iterator::value_type>(cout, " "));}int main(){ vector coll; // 输入 copy(istr 阅读全文

posted @ 2013-10-18 21:13 FlowingCloud 阅读(753) 评论(0) 推荐(0) 编辑

导航