File indexing completed on 2026-04-09 07:49:13
0001
0002
0003
0004
0005
0006 #include <cstdio>
0007
0008 class A {
0009 public:
0010 virtual void methodA(int) { printf("A::methodA(int)\n") ; }
0011 virtual void methodA(int, int, int) { printf("A::methodA(int, int, int)\n") ; }
0012 };
0013
0014 class B : public A {
0015 public:
0016
0017 #ifdef WITH_FIX
0018 using A::methodA;
0019 #endif
0020
0021 virtual void methodA(int) { printf("B::methodA(int)\n") ; }
0022 };
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 int main()
0034 {
0035 A a;
0036 printf("a.methodA(7)\n");
0037 a.methodA(7);
0038
0039 printf("a.methodA(7,7,7)\n");
0040 a.methodA(7, 7, 7);
0041
0042 B b;
0043 A *pa = &b;
0044
0045 printf("pa->methodA(7) : calls B impl \n");
0046 pa->methodA(7);
0047
0048 printf("pa->methodA(7,7,7) : calls A impl \n");
0049 pa->methodA(7, 7, 7);
0050
0051
0052 b.methodA(7);
0053
0054 #ifdef WITH_FIX
0055 b.methodA(7, 7, 7);
0056 #else
0057
0058 #endif
0059
0060 return 0 ;
0061 }