Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove template parameter from function calls to fix ambiguous function overload #110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smirnov-d-a
Copy link

In file-transfer.cpp function calls of addPendingRequest() in both downloadFileInline() and startStandardDownload() functions seem to break compilation due to ambiguous function overload. At least, this happens when compiling with gcc 4.9.2.

file-transfer.cpp:329:77: error: call of overloaded 'addPendingRequest(uint64_t&, std::remove_reference<std::unique_ptr<DownloadRequest>&>::type)' is ambiguous
     account.addPendingRequest<DownloadRequest>(requestId, std::move(request));

Hopefully, this is fixed by removing template parameter from these function calls.

…ion overload.

addPendingRequest() function calls in downloadFileInline() and startStandardDownload() functions break compilation due to ambiguous function overload, which is fixed by removing template parameter from these function calls.
@BenWiederhake
Copy link
Contributor

Huh, you really did mean removing it. That's weird. Why would removing information make something less ambiguous?

@smirnov-d-a
Copy link
Author

Well, here's a rough suggestion.
If I understand correctly the concept of C++ templates, when template parameter is not specified, the compiler tries to guess it from arguments of the function. But when it is specified and does not match the actual arguments, I suppose, there would be the error. Maybe, that's the case. I haven't dug the code that much as to check matching of the types.

And again, I'm not sure, but all this could very well be just because of the old compiler that I am using (gcc 4.9.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants