lis-end

////////////////////////////////////////
//      2018/04/25 21:25:43
//      lis-end

// returns an iterator to the end
#include <iostream>
#include <list>
#include <numeric>

using namespace std;

int main(){
    list<int> li(10);
    iota(li.begin(),li.end(),1);

    list<int>::iterator it = li.begin();
    while (it != li.end()){
        cout << *(it++) << " ";
    }
    cout << endl;
    return 0;
}


/*
OUTPUT:
  1 2 3 4 5 6 7 8 9 10
*/
posted @   老耗子  阅读(57)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示