Namespaces
Variants
Views
Actions

Talk:cpp/language/overload resolution

From cppreference.com

[edit] wrong code snippet in 'Ranking of implicit conversion sequences' section

struct Base {};
struct Derived : Base {} b;
int f(A&); // overload #1
int f(B&); // overload #2
int i = f(b); // b -> B& has rank Exact Match
              // b -> A& has rank Conversion
              // calls f(B&)

What are A and B types used in function arguments ??? --92.255.187.52 06:32, 18 October 2013 (PDT)

Good catch, fixed. --Cubbi (talk) 07:02, 18 October 2013 (PDT)