简体   繁体   English

无法将 function 解析为任何重载实例

[英]Cannot resolve function to any overloaded instance

I have looked into other answers to resolve this but no luck.我已经研究了其他答案来解决这个问题,但没有运气。 So, here is the problem:所以,这是问题所在:

I have two functions我有两个功能

string vts(vector<int> ,/*default*/ bool = true,/*default*/ bool = true);
string vts(vector<string> ,/*default*/ bool = true);

During debugging, it seems like GDB is not able to resolve b/w the two functions for a vector<int> .在调试期间,似乎 GDB 无法解析vector<int>的两个函数。

It throws following error它抛出以下错误

(gdb) call vts(v)
Cannot resolve function vts to any overloaded instance

where在哪里

v = std::vector<int> of length 5, capacity 5 = {1, 2, 3, 4, 5}

Invocation by passing all arguments also fail通过传递所有 arguments 的调用也失败

Invokation
(gdb) call vts(v, false, false)

Output
Cannot resolve function vts to any overloaded instance

I have tried setting overload-resolution on and off but does not work.我试过打开和关闭过载分辨率但不起作用。 Any pointers to fix this would be helpful?解决此问题的任何指示都会有所帮助吗?

Ultimately, I had to use the complete function signature to make the call complete.最终,我不得不使用完整的 function 签名来完成调用。

 p 'vts(std::vector<int,std::allocator<int>>,bool,bool)'(v,0,0)

The reported behaviour does seem like a bug in gdb.报告的行为看起来确实像是 gdb 中的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM