本文介绍了有没有一个好的方法来搜索的键和值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前在C ++中使用 map< int,int> 。我可以检查一个键的存在没有问题,但有一个有效的方法来检索特定值具有的键?我的目的是用给定的值获取所有元素,然后更新它们的值。
I am currently using map<int, int> in C++. I can check for the existence of a key without a problem but is there an efficient way to retrieve the keys that a particular value has as well? My purpose is to grab all the elements with a given value and then update their value.
推荐答案href =www.boost/doc/libs/1_44_0/libs/bimap/doc/html/index.html =nofollow> Boost.Bimap 。
You might be interested in Boost.Bimap.
更多推荐
有没有一个好的方法来搜索的键和值?
发布评论