Commit | Line | Data |
---|---|---|
71ea1be0 MC |
1 | // 2002-05-13 |
2 | ||
3 | namespace __gnu_test | |
4 | { | |
5 | enum region { oriental, egyptian, greek, etruscan, roman }; | |
6 | ||
7 | // Test one. | |
8 | class gnu_obj_1 | |
9 | { | |
10 | protected: | |
11 | typedef region antiquities; | |
12 | const bool test; | |
13 | const int key1; | |
14 | long key2; | |
15 | ||
16 | antiquities value; | |
17 | ||
18 | public: | |
19 | gnu_obj_1(antiquities a, long l): test(true), key1(5), key2(l), value(a) {} | |
20 | }; | |
21 | ||
22 | // Test two. | |
23 | template<typename T> | |
24 | class gnu_obj_2: public virtual gnu_obj_1 | |
25 | { | |
26 | protected: | |
27 | antiquities value_derived; | |
28 | ||
29 | public: | |
30 | gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { } | |
31 | }; | |
32 | ||
33 | // Test three. | |
34 | template<typename T> | |
35 | class gnu_obj_3 | |
36 | { | |
37 | protected: | |
38 | typedef region antiquities; | |
39 | gnu_obj_2<int> data; | |
40 | ||
41 | public: | |
42 | gnu_obj_3(antiquities b): data(etruscan) { } | |
43 | }; | |
44 | } | |
45 | ||
46 | int main() | |
47 | { | |
48 | using namespace __gnu_test; | |
49 | gnu_obj_1 test1(egyptian, 4589); | |
50 | gnu_obj_2<long> test2(roman); | |
51 | gnu_obj_3<long> test3(greek); | |
52 | return 0; | |
53 | } |