看了好多关于STL multimap的使用方法,但就这个还是较简洁。现转过来,算是笔记吧:
结果:
Compile: g++ testMultimap.cpp
Run: ./a.out
Number of elements with key a: 2
Number of elements with key b: 3
Number of elements with key c: 1
Elements in m:
[a, 1]
[a, 5]
[b, 3]
[b, 4]
[b, 6]
[c, 2]
Range of "b" elements:
[b, 3]
[b, 4]
[b, 6]
来源:http://www.yolinux.com/TUTORIALS/CppStlMultiMap.html