zoukankan      html  css  js  c++  java
  • deque-pop_front

    ////////////////////////////////////////
    //      2018/04/24 19:57:03
    //      deque-pop_front
    
    #include <iostream>
    #include <deque>
    #include <algorithm>
    
    using namespace std;
    
    template<class T>
    class Print{
    public:
        void operator ()(T& t){
            cout << t << " ";
        }
    };
    
    //=========================
    int main(){
        deque<int> d;
        Print<int> print;
        for (int i = 0; i < 5; i++){
            d.push_back(i + 1);
        }
        while (!d.empty()){
            for_each(d.begin(),d.end(), print);
            cout << endl;
            d.pop_front();
        }
        return 0;
    }
    
    /*
    OUTPUT:
        1 2 3 4 5
        2 3 4 5
        3 4 5
        4 5
        5
    */ 
  • 相关阅读:
    map侧连接
    二次排序
    倒排索引
    多表关联
    单表关联
    Shuffle
    Partitioner
    Combiner
    CSS3中的多列
    CSS3动画
  • 原文地址:https://www.cnblogs.com/laohaozi/p/12537991.html
Copyright © 2011-2022 走看看