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
*/
原文地址:https://www.cnblogs.com/laohaozi/p/12537967.html