Update copyright year to 2014 by running admin/update-copyright.
[emacs.git] / test / cedet / tests / testtypedefs.cpp
blob8647b70c0ed23015bae853cb140b9b421a90efba
1 // testtypedefs.cpp --- Sample with some fake bits out of std::string
3 // Copyright (C) 2008-2014 Free Software Foundation, Inc.
5 // Author: Eric M. Ludlam <eric@siege-engine.com>
7 // This file is part of GNU Emacs.
9 // GNU Emacs is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 3 of the License, or
12 // (at your option) any later version.
14 // GNU Emacs is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 // Thanks Ming-Wei Chang for these examples.
24 namespace std {
25 template <T>class basic_string {
26 public:
27 void resize(int);
31 typedef std::basic_string<char> mstring;
33 using namespace std;
34 typedef basic_string<char> bstring;
36 int main(){
37 mstring a;
38 a.// -1-
40 // #1# ( "resize" )
41 bstring b;
42 // It doesn't work here.
43 b.// -2-
45 // #2# ( "resize" )
46 return 0;
49 // ------------------
51 class Bar
53 public:
54 void someFunc() {}
57 typedef Bar new_Bar;
59 template <class mytype>
60 class TBar
62 public:
63 void otherFunc() {}
66 typedef TBar<char> new_TBar;
68 int main()
70 new_Bar nb;
71 new_TBar ntb;
73 nb.// -3-
75 // #3# ("someFunc")
76 ntb.// -4-
78 // #4# ("otherFunc")
79 return 0;