简体   繁体   中英

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> .

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

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.

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

The reported behaviour does seem like a bug in gdb.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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