腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(1691)
视频
沙龙
1
回答
std
::
find_if
映
射到
对象
c++
、
c++11
、
c++17
我应该使用示例1还是示例2来将指针从
find_if
映
射到
object,哪个是最好的?struct test {} return
浏览 6
提问于2019-05-25
得票数 0
回答已采纳
1
回答
唯一指针的向量:通过指针找到一个元素,然后旋转到向量的前面。
c++
、
algorithm
、
find
、
c++20
、
unique-ptr
假设我有一个指向
对象
的唯一指针的
std
::vector。#include <memory> 现在假设向量填充了一些
对象
我尝试使用像这样的
find_if
函数来找到一个支点:
浏览 2
提问于2021-07-17
得票数 1
回答已采纳
3
回答
性病的替代品::bind2
c++
、
c++11
、
bind
、
bind2nd
我有一个foo,它是一个
std
::vector<int>。它表示一组范围的“边缘”值。
std
::
find_if
( foo.end(),
std
::bind2nd(
std
::greater<int>(我的问题是:
std
::bind2nd被废弃了,所以我应该重构。使用更新函数的等效语句是什么
浏览 6
提问于2015-09-23
得票数 16
回答已采纳
2
回答
std
::将局部变量绑定为值
c++
、
lambda
、
bind
、
std
绑定到一个局部变量的值是一种良好的实践吗:{}auto str = getRandomString(); vec.begin(),
std
::bind(func, str,
std
::pl
浏览 6
提问于2015-02-05
得票数 1
回答已采纳
3
回答
在
对象
的向量上使用
find_if
vector
、
c++
foo_v;比如说,在main中{}
std
::
find_if
(myClass_v.begin(),myClass_v.end(),condition);bool MyClass::condition我以为
std
::
find_if
会调用c
浏览 0
提问于2011-07-13
得票数 35
回答已采纳
3
回答
如何搜索列表元素,STL C++
c++
、
stl
我试着用find或
find_if
,但从来都不管用,不知道怎么写谓词,有什么想法吗?
浏览 3
提问于2013-08-03
得票数 0
5
回答
STL算法与const_iterators
c++
、
stl
、
iterator
、
find
、
constants
但是我面临一个问题:我想在类的const方法中的
std
::
find_if
调用中使用这个谓词,在这个类的成员容器中进行搜索。但我只是注意到,
std
::find和
std
::
find_if
都不能在const_iterators上操作!我查看了一些C++引用,似乎没有接受/返回const_iterators的
std
::find或
std
::
find_if
版本。我只是不明白为什么,因为据我所见,这些算法不可能修改迭代器引用的
对象
。以下是
浏览 0
提问于2009-10-27
得票数 5
回答已采纳
1
回答
std
::
find_if
on
std
::具有重复数据的自定义
对象
向量
c++
、
vector
、
std
考虑以下情况:{
std
::string dn;{
std
::vector<MyStruct>::iterator it =
std
::
find_if
(v.begin(), v.end(),[c](const MyStruct& m) -> bool { return m.cn == c; });
浏览 0
提问于2015-12-28
得票数 2
回答已采纳
3
回答
如何在向量中找到某些东西
c++
、
stl
、
vector
我有一个指向有建筑物的矢量的指针。building1 = gamer.getBuilding(); ( building1 is a pointer to vector with all buildings that gamer has on that moment. )我想我可以这样做 it = find((*building1).begin(), (*building1).end()
浏览 2
提问于2011-11-19
得票数 1
5
回答
C++ lambda语法
c++
、
lambda
koalaGraph::PVertex lookUpByName(
std
::string Name,
std
::vector<koalaGraph::PVertex>& Vertices) {Vertices[i]->info.name == Name) }我的问题是,如何将其作为lambda来实现,以便将其与
std
::
find_if
结合使用?我在尝试这个:
std
::vector<koalaG
浏览 0
提问于2019-03-19
得票数 10
3
回答
结构的搜索向量
c++
、
algorithm
、
struct
、
iterator
、
find
我有这样的结构: int id; string colour; int quantity;}vector<Stock> all_data;
浏览 4
提问于2019-12-04
得票数 0
回答已采纳
1
回答
如何使用一些boost库使
std
::
find_if
和
std
::map协同工作?
c++
、
boost
、
map
、
boost-fusion
、
boost-phoenix
典型的C++03解决方案定义了一个专用函数(或函子),并将其作为第三个参数传递给
std
::
find_if
。如果它是向量,那么我刚刚学习了一个使用Boost.Phoenix的很酷的解决方案,解决方案变得非常简洁():auto it =
std
::
find_if
(v.begin(), v.end(), arg1 > 4); 这里,arg1是在boost::phoenix::arg_names命名空间中定义的函子
对象
,表达
浏览 0
提问于2011-09-07
得票数 6
回答已采纳
3
回答
简化简单的C++代码--类似于Pythons的任何代码
c++
、
python
、
any
现在,我有一个密码: for(
std
::list< boost::shared_ptr<Foo> >::iterator i = mylist.begin(
浏览 3
提问于2010-08-08
得票数 5
回答已采纳
6
回答
使用自定义比较器查找C++
std
::find
c++
、
stl
这基本上就是我想要做的:{} find(strings.begin(), strings.end(), "**rld", special_compare); 但不幸的是,
std
浏览 0
提问于2013-01-15
得票数 33
回答已采纳
2
回答
在tr1::shared_ptr的向量中查找元素
c++
、
boost
、
stl
、
find
、
shared-ptr
我已经将我的自定义类型'MyType‘包装在一个智能指针中:并由此生成一个向量:现在我想在该向量中
std
::find一个MyType类型的
对象
,但不能,因为我需要的类型是shared_ptr<MyType>。谢谢 更新:为什么不是
std
::
find_if
:
std
::find的用法非常紧凑。我认为为
find_if
实现一个方法或
浏览 1
提问于2013-01-10
得票数 3
回答已采纳
3
回答
如何根据类属性在向量中查找
对象
?
c++
、
vector
、
find
我有一个属性为
std
::string attributeName的Attribute类。我想开发一个简单的函数,它返回具有与提供的字符串匹配的attributeName的Attribute的索引。
浏览 1
提问于2013-02-25
得票数 4
5
回答
在结构的
std
::矢量中查找
c++
、
if-statement
、
find
、
stdvector
我有:{ int* somethingElse;我需要在
std
::vector<MyStruct*>中(通过使用
std
::
find_if
std
::
find_if
的Predicate (如果我理解正确的话)是一个普通的函数,它接受一个MyStruct指针,我不知道在哪里可以指定在比较中使用的额外"XYZ"值。那么,我如何使用
std
::
find_if
或此用途呢?(显
浏览 2
提问于2013-02-11
得票数 2
回答已采纳
2
回答
可以将虚拟函数和函数
对象
混合在一起使用
std
算法吗?
c++
、
algorithm
、
stl
、
polymorphism
、
functor
::
find_if
each time while () ObjVec::iterator it =
std
::
find_if
(Objs.begin(), Objs.end(), finder); { MyObjVec::iterator it =
std
::<
浏览 0
提问于2014-01-18
得票数 0
3
回答
在
find_if
中使用谓词
c++
、
string
、
algorithm
struct MaxWinPerElementInfo
std
::string paytableName; long long为此,我计划在谓词函数中使用
std
::
find_if
。我将struct MaxWinPerElementInfo中的函数
对象
声明为, return paytabl
浏览 3
提问于2014-03-26
得票数 1
回答已采纳
2
回答
如何检查
对象
数组是否具有所引用的
对象
c++
、
arrays
它鼓励用户创建最多10个帐户
对象
,然后将它们插入到
对象
数组中。稍后,我需要引用数组中的某些
对象
来使用引用
对象
生成预测,到目前为止,这就是我所做的。
浏览 8
提问于2016-09-17
得票数 1
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
苹果申请与工业增强现实摄像头系统相关专利
哈工大硕士生用 Python 实现了 11 种经典数据降维算法,源代码库已开放
30天拿下Rust之HashMap
Meta发布多个示例展示Quest Movement SDK身体追踪灵活性
C+从零实现神经网络
热门
标签
更多标签
活动推荐
运营活动
广告
关闭
领券