如何在助推向量中查找项目
How to find an item in boost vector
我正在使用Boost库的vector
,我需要检查是否存在特定项。Boost中是否有类似STL查找算法的功能,例如std::find(vector.begin,vector.end, element)
?
以下代码作为stl查找算法工作
包括标题
#include"boostrangealgorithmfind.hpp"
int main()
{
boost::container::vector<int> my_intvector;
my_intvector.push_back(1);
my_intvector.push_back(2);
my_intvector.push_back(3);
my_intvector.push_back(4);
my_intvector.push_back(5);
boost::container::vector::iterator it;
it = boost::find(my_intvector,3);
}
相关文章:
- 查找项目在哈希表中的位置
- 如何在Cmake中正确查找头路径,以便在我的项目中构建Box2D
- Visual Studio 2015资源视图和资源编译器使用不同的方法在项目目录中查找图标文件.如何修复
- 在5d映射C++中查找项目
- 通过查找一对项目的代码获取错误的输出,在给定的总和相等的给定列表中列表
- 查找两个 3 位数字的乘积(欧拉项目 #4)
- 更改 std::set 以按 T 类型查找项目
- C 使用字符串项目在列表中查找结构
- unordered_map仅查找先前找到的项目之后的项目
- 使用STD ::查找从向量中选择项目
- STD :: MAP-如何查找或添加,然后可以在一次搜索中删除项目
- 从项目名称查找 API 中查找项目
- 在给定键 (C++) 的地图向量内查找项目
- 如何在助推向量中查找项目
- 如何在 std::vector 中查找项目的位置
- 根据世界位置查找一维数组中的通用项目
- 如何在场景中查找项目
- 如何检查/查找项目是否在DEQUE中
- 在矢量中查找项目
- 如何在ublas::矩阵中查找项目的所有出现项