std::find在xutility C++中出现问题
std::find is having issues in xutility C++
在我的程序中,我有一个看起来像的函数
bool InstalledProgram::IsProgInList(String^ ProgramName, list<InstalledProgram> ListCheck) {
if (find(ListCheck.begin(), ListCheck.end(), ProgramName) != ListCheck.end()) {
return true;
}
else {
return false;
}
}
当我去调试整个东西时,我得到了
C:Program Files (x86)Microsoft Visual Studio 12.0VCincludexutility(3045) : see reference to function template instantiation '_InIt std::_Find<_InIt,_Ty>(_InIt,_InIt,const _Ty &,std::false_type)' being compiled
with
[
_InIt=std::_List_unchecked_iterator<std::_List_val<std::_List_simple_types<InstalledProgram>>>,
_Ty=System::String ^
]
它不会告诉我任何关于我实际代码文件的信息,但这是我唯一使用find的地方,所以它必须在这里。我花了一段时间试图绕过这一点,现在运气不错。有人看到问题了吗?我知道ProgramName
应该是String^ const &_Val
,但我不确定我是否理解这意味着什么以及它有什么不同。
容器ListCheck
包含InstalledProgram
类型的对象,但您正在搜索String^
(c++-cli
)类型的元素
您可能需要定义一个自定义的一元谓词并使用std::find_if
相关文章:
- 警告处理为错误这里有什么问题
- 最小硬币更换问题(自上而下方法)
- 为"adjacent"变量赋值时出现问题
- 我的神经网络不起作用 [XOR 问题]
- 在Ubuntu 16.04上安装Cilk时出现问题
- C++我的数学有什么问题,为什么我的代码不能正确循环
- 编译包含字符串的代码时遇到问题
- Project Euler问题4的错误解决方案
- 问题:什么是QAbstractItemView::NoEditTriggers的反面
- 在编译C++代码(具有dlib和opencv)到WASM时面临问题
- 在进程中对同一管道进行读取和写入时C++管道出现问题
- 静态数据成员的问题-修复链接错误会导致编译器错误
- C++ 雷神库 - 使用资源加载器类时出现问题(不命名类型)
- 一个关于在C++中重载布尔运算符的问题
- 首要问题的答案让值班员搞错了
- setlocale的C++土耳其字符串问题
- 如何重构类层次结构以避免菱形问题
- 基于boost的程序的静态链接——zlib问题
- C++格式化输出问题
- std::find在xutility C++中出现问题