Last change
on this file since 45 was
29,
checked in by landauf, 17 years ago
|
updated boost from 1_33_1 to 1_34_1
|
File size:
658 bytes
|
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 | namespace inherit { |
---|
7 | |
---|
8 | template<typename T> |
---|
9 | class A |
---|
10 | { |
---|
11 | public: |
---|
12 | void set(T v) { mData = v; } |
---|
13 | |
---|
14 | T get() const { return mData; } |
---|
15 | |
---|
16 | private: |
---|
17 | T mData; |
---|
18 | }; |
---|
19 | |
---|
20 | |
---|
21 | class B : public A<int> |
---|
22 | { |
---|
23 | public: |
---|
24 | int go() { return get(); } |
---|
25 | }; |
---|
26 | |
---|
27 | struct C : B |
---|
28 | { |
---|
29 | enum ab { a = 1, b = 2 }; |
---|
30 | int f1() { return 1; } |
---|
31 | int x; |
---|
32 | static int s; |
---|
33 | }; |
---|
34 | |
---|
35 | struct D : C |
---|
36 | { |
---|
37 | int f2() { return 2; } |
---|
38 | int y; |
---|
39 | }; |
---|
40 | |
---|
41 | struct X {}; |
---|
42 | struct E: X, D {}; |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.