deque-end

////////////////////////////////////////
//      2018/04/23 18:58:27
//      deque-end
#include <iostream>
#include <deque>
#include <iterator>
#include <numeric>

using namespace std;

int main(){
    deque<int> d(5);
    iota(d.begin(),d.end(),1);
    deque<int>::iterator it = d.begin();
    while (it != d.end()){
        cout << *(it++) << " ";
    }
    cout << endl;

    //last element of the deque
    it = d.end() - 1;
    cout << *it << endl;
    return 0;
}


/*
OUTPUT:
    1 2 3 4 5
    5
*/ 
原文地址:https://www.cnblogs.com/laohaozi/p/12538004.html