1 | class A { |
---|---|
2 | public: |
3 | virtual int foo() { return 1; } |
4 | virtual ~A () = default; |
5 | A() = default; |
6 | }; |
7 | |
8 | class B : public A { |
9 | public: |
10 | virtual int foo() { return 2; } |
11 | virtual ~B () = default; |
12 | B() = default; |
13 | }; |
14 | |
15 | int main() { |
16 | A* a = new B(); |
17 | a->foo(); // break here |
18 | return 0; // break here |
19 | } |
20 | |
21 |