• multimap-max_size


    ////////////////////////////////////////
    //      2018/05/04 21:33:23
    //      multimap-max_size
    
    // the maxinum number of elements that the maltimap can hold 
    #include <iostream>
    #include <map>
    #include <functional>
    
    using namespace std;
    
    int main(){
        typedef multimap<int, char, greater<int>> M;
        typedef M::value_type v_t;
        M m;
    
        m.insert(v_t(2,'B'));
        m.insert(v_t(3,'C'));
        m.insert(v_t(1,'A'));
    
        M::iterator it = m.begin();
        cout << "m:" << endl;
        while (it != m.end()){
            cout << it->first << "-" << it->second << endl;
            it++;
        }
        cout << "size of multimap 'm'" << m.size() << endl;
        cout << "max_size of 'm' " << m.max_size() << endl;
    
        return 0;
    }
    
    
    /*
    OUTPUT:
        m:
        3-C
        2-B
        1-A
        size of multimap 'm'3
        max_size of 'm' 178956970
    */ 
  • 相关阅读:
    node.js中常用的fs文件系统
    秒懂 this
    Filter 过滤器
    Ubuntu 安装zookeeper
    Vmware 设置NAT模式
    TreeMap
    ArrayList扩容
    Java 面试题收集
    SwitchyOmega 设置修改代理
    Jedis操作Redis
  • 原文地址:https://www.cnblogs.com/laohaozi/p/12537826.html
Copyright © 2020-2023  润新知