| 1 | struct dont_care { dont_care(...); };
|
|---|
| 2 | struct A {};
|
|---|
| 3 | struct B { B(const A&) {} };
|
|---|
| 4 |
|
|---|
| 5 | struct C
|
|---|
| 6 | {
|
|---|
| 7 | #ifdef USE_TEMPLATE
|
|---|
| 8 | template < typename T > static void f(const T&) {}
|
|---|
| 9 | #else
|
|---|
| 10 | static void f(const B&) {}
|
|---|
| 11 | #endif
|
|---|
| 12 | static void f(dont_care) {}
|
|---|
| 13 | };
|
|---|
| 14 |
|
|---|
| 15 | int main()
|
|---|
| 16 | {
|
|---|
| 17 | C::f(A());
|
|---|
| 18 | }
|
|---|