对象错误地显示为引用?
Object Incorrectly Showing Up As Reference?
为清楚起见进行了编辑:
我有一个向量向量,allPaths,以及一个向量,路径,我试图将其添加到allPaths中。 allPath 通过引用传递,路径通过值传递到函数中。
当尝试做
allPaths.insert(path);
我收到错误,即使路径是一个值,我也无法添加对 allPath 的引用:
error: no matching function for call to ‘std::vector<std::vector<llvm::Instruction*> >::insert(std::vector<llvm::Instruction*>&)’
allPaths.insert(path);
^
allPaths是一个vector<std::vector<llvm::Instruction*>&
。 路径是vector<llvm::Instruction*>
。
为什么path
参数显示为错误中对向量的引用,而不是实际向量?
任何建议将不胜感激!我对C++和LLVM都很陌生,所以我的一些假设也可能是不正确的。
std::vector::insert
对一个参数没有重载。
你的意思是push_back
而不是insert
?
相关文章:
- 在编译它时显示未定义的引用
- 对象错误地显示为引用?
- Android (ART) 崩溃并显示错误 JNI 在应用程序中检测到错误:jstring 是无效的本地引用
- 当通过引用传递 QObject 时,C++信号的参数在 QML 中显示为"未定义"
- std::tie 在从函数调用传递值时失败,并显示"无法绑定非常量左值引用"
- 为什么下面的代码在通过引用传递时没有显示错误
- 按值传递的参数在 Visual Studio 2010, C++ 的调试器中显示为通过引用传递
- Visual Studio 中的"指向引用的指针"错误不会按发生位置的文件名显示
- 堆栈在函数中弹出仍然显示在主函数中。调用不应该通过引用给定的向量吗
- Linux Flex gcc 编译失败,并显示"未定义对 'TclReError'的引用"
- 引用变量在下一行程序执行后显示未找到的行为
- SHELL_NOTIFYICON:尝试引用不存在的令牌,没有显示图标
- 为什么每次生成时,本地 .NET 程序集在引用列表中(几乎)都显示为损坏
- 使用 Visual Studio 创建的静态库在与代码块一起使用时显示对 Myfunction 的未定义引用
- 带有标准容器和常量引用的c++代码显示出意外的内存
- Visual Studio 2013未显示未引用的变量警告
- 禁止显示编译器警告 声明从未引用的函数
- 尽管netbeans在代码完成中显示了函数,但未定义引用
- 如果类型在声明之前被引用,如何在Xtext IDE中显示错误
- 当我按值传递参数时,c++构建消息显示一个引用参数