最近在项目代码中看到了boost::bimap< multiset_of<A>, multiset_of<B>, with_info<C> >这样的类型。虽然我用过boost::bimap,可那只是很简单的应用。这个mulstiset_of让我感到了一点困惑。
直接在网上搜multiset_of没找到多少有用的信息,看了两篇提到它的文章,还是有点不清楚这是什么东西。后来感觉可能是因为自己在数学上就没接触过multiset这个概念,也没用过STL中的multiset。如果用过STL的multiset的话,理解bimap中的multiset_of可能就会容易很多了。
先留下几条链接,回家后研究研究。
multiset的数学概念:
http://en.wikipedia.org/wiki/Multiset
STL中的multiset:
http://www.cplusplus.com/reference/set/multiset/
http://blog.csdn.net/cumirror/article/details/5526485
提到boost::bimap::multiset_of的文章:
http://www.cnblogs.com/lin1270/archive/2011/01/12/1933908.html
http://stackoverflow.com/questions/8441846/how-to-traverse-a-map-by-value