c++ function overload resolution regarding templated type and class hierarchy
By : Kunal Khairnar
Date : October 15 2020, 01:18 AM
hop of those help? All things being equal, overload resolution prefers nontemplate functions to function templates. However, in this case, all things are not equal. To match your overload for Base*, a derived-to-base pointer conversion is necessary; no conversion is necessary to match the function template. Thus, the function template is selected for Derived*. The "simple," albeit probably error-prone, solution would be to cast your Derived* to a Base* before you call the function.
Templated operator overload resolution, member vs non-member function
By : Red Knight
Date : March 29 2020, 07:55 AM
Any of those help Overload resolution adds an additional parameter to a member function just for the purpose of overload resolution: [over.match.funcs]/2