multimap-end

////////////////////////////////////////
//      2018/05/04 9:51:26
//      multimap-end

// returns an iterator to the last elements
#include <iostream>
#include <map>
#include <string>

using namespace std;

int main(){
    typedef multimap<string, int> M;
    typedef M::value_type v_t;
    M m;

    m.insert(v_t("first",100));
    m.insert(v_t("second",200));
    m.insert(v_t("third",300));
    m.insert(v_t("second",400));
    m.insert(v_t("third",500));

    M::iterator it = m.begin();
    cout << "m:" << endl;
    while (it != m.end()){
        cout << it->first << "-" << it->second << endl;
        it++;
    }
    return 0;
}

/*
OUTPUT:
    second-400
    third-300
    third-500
*/ 
原文地址:https://www.cnblogs.com/laohaozi/p/12537835.html