]> code.delx.au - gnu-emacs/blob - test/cedet/tests/testtypedefs.cpp
License updates for some test/cedet/tests files.
[gnu-emacs] / test / cedet / tests / testtypedefs.cpp
1 // Sample with some fake bits out of std::string
2 //
3 // Thanks Ming-Wei Chang for these examples.
4
5 namespace std {
6
7 template <T>class basic_string {
8
9 public:
10 void resize(int);
11
12 };
13
14 }
15
16 typedef std::basic_string<char> mstring;
17
18 using namespace std;
19 typedef basic_string<char> bstring;
20
21
22 int main(){
23 mstring a;
24
25 a.// -1-
26 ;
27 // #1# ( "resize" )
28
29 bstring b;
30 // It doesn't work here.
31 b.// -2-
32 ;
33 // #2# ( "resize" )
34
35 return 0;
36 }
37
38
39 // ------------------
40
41 class Bar
42 {
43 public:
44 void someFunc() {}
45
46 };
47
48 typedef Bar new_Bar;
49
50 template <class mytype>
51 class TBar
52 {
53 public:
54 void otherFunc() {}
55
56 };
57
58 typedef TBar<char> new_TBar;
59
60 int main()
61 {
62 new_Bar nb;
63 new_TBar ntb;
64
65 nb.// -3-
66 ;
67 // #3# ("someFunc")
68
69 ntb.// -4-
70 ;
71 // #4# ("otherFunc")
72
73 return 0;
74 }
75
76 // arch-tag: 5a841384-8685-4344-bf45-15d3db19a87b