有没有一个好的方法来搜索的键和值?

编程入门 行业动态 更新时间:2024-10-15 02:27:37
本文介绍了有没有一个好的方法来搜索的键和值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我目前在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.

更多推荐

有没有一个好的方法来搜索的键和值?

本文发布于:2023-11-23 18:54:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622522.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方法来

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!