Created on 2015-03-27.00:00:00 last changed 130 months ago
There are overload tiebreakers that order reference/nonreference and base/derived conversions, but how they relate is not specified. For example:
struct A { A(); };
struct B : A {};
struct C : B {};
void f1(B&);
void f1(A);
void f2(B);
void f2(A&);
int main()
{
C v;
f1(v); // all compilers choose f1(B&)
f2(v); // all compilers choose f2(B)
}
The Standard does not appear to specify what happens in this case.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2015-03-27 00:00:00 | admin | create | |