Kevin Ryde <user42 at zip.com.au>
[bpt/emacs.git] / test / cedet / tests / testtypedefs.cpp
CommitLineData
74ea13c1
CY
1// Sample with some fake bits out of std::string
2//
3// Thanks Ming-Wei Chang for these examples.
4
5namespace std {
6
7 template <T>class basic_string {
8
9 public:
10 void resize(int);
11
12 };
13
14}
15
16typedef std::basic_string<char> mstring;
17
18using namespace std;
19typedef basic_string<char> bstring;
20
21
22int 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
41class Bar
42{
43public:
44 void someFunc() {}
45
46};
47
48typedef Bar new_Bar;
49
50template <class mytype>
51class TBar
52{
53public:
54 void otherFunc() {}
55
56};
57
58typedef TBar<char> new_TBar;
59
60int 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}