Errors, bugs, questions - page 1639
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Who is solving the problem now, when a template method in a template class is not found by the compiler for some reason and an error occurs?
no one of overloads can be applied to the function call
?
C compilers in such cases write specifically what types were substituted and what functions with what prototype are not found, so it is more or less clear what the problem is, but here - no specifics.
We did this deliberately, as there is no problem with direct inheritance.
I'd like to see the exact rule: when do I have the right to override a virtual function with a different type of return value?
Or is it an overload?
I would like to see the exact rule: when do I have the right to override a virtual function with a different type of return value?
Thank you. It all makes sense.
...when the return type of an overridden function is inherited ... from the type returned by the overridden one.
What if it's the other way around?
What if it's the other way around?
You have an error in your example - no inheritance of D from C
Yes, my mistake, sorry.
Another controversial example:
Another controversial example:
Despite the error (because there will be no executable generation), function B::f overrides A::f, so there is no override error for C::f.
I don't quite get the idea, but it's almost the same
There is an error in one case and no error in the other. And I just swapped the lines