Line | |
---|
1 | /* Copyright Bruno da Silva de Oliveira 2003. Use, modification and |
---|
2 | distribution is subject to the Boost Software License, Version 1.0. |
---|
3 | (See accompanying file LICENSE_1_0.txt or copy at |
---|
4 | http:#www.boost.org/LICENSE_1_0.txt) |
---|
5 | */ |
---|
6 | #include <vector> |
---|
7 | #include <string> |
---|
8 | |
---|
9 | namespace abstract { |
---|
10 | |
---|
11 | struct A { |
---|
12 | virtual ~A() {} |
---|
13 | virtual std::string f()=0; |
---|
14 | }; |
---|
15 | |
---|
16 | struct B: A { |
---|
17 | std::string f() { return "B::f"; } |
---|
18 | }; |
---|
19 | |
---|
20 | std::string call(A* a) { return a->f(); } |
---|
21 | |
---|
22 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.