Update copyright in libstdc++-v3.
[official-gcc.git] / libstdc++-v3 / testsuite / 21_strings / headers / string / synopsis.cc
blob3186f91df302382697630d10f4ed1972460b70ee
1 // { dg-do compile }
3 // Copyright (C) 2007-2013 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
20 #include <string>
22 namespace std {
23 // lib.char.traits, character traits:
24 template<class charT>
25 struct char_traits;
26 template <> struct char_traits<char>;
27 template <> struct char_traits<wchar_t>;
29 // lib.basic.string, basic_string:
30 template<class charT, class traits, class Allocator >
31 class basic_string;
33 template<class charT, class traits, class Allocator>
34 basic_string<charT,traits,Allocator>
35 operator+(const basic_string<charT,traits,Allocator>& lhs,
36 const basic_string<charT,traits,Allocator>& rhs);
37 template<class charT, class traits, class Allocator>
38 basic_string<charT,traits,Allocator>
39 operator+(const charT* lhs,
40 const basic_string<charT,traits,Allocator>& rhs);
41 template<class charT, class traits, class Allocator>
42 basic_string<charT,traits,Allocator>
43 operator+(charT lhs, const basic_string<charT,traits,Allocator>& rhs);
44 template<class charT, class traits, class Allocator>
45 basic_string<charT,traits,Allocator>
46 operator+(const basic_string<charT,traits,Allocator>& lhs,
47 const charT* rhs);
48 template<class charT, class traits, class Allocator>
49 basic_string<charT,traits,Allocator>
50 operator+(const basic_string<charT,traits,Allocator>& lhs, charT rhs);
52 template<class charT, class traits, class Allocator>
53 bool operator==(const basic_string<charT,traits,Allocator>& lhs,
54 const basic_string<charT,traits,Allocator>& rhs);
55 template<class charT, class traits, class Allocator>
56 bool operator==(const charT* lhs,
57 const basic_string<charT,traits,Allocator>& rhs);
58 template<class charT, class traits, class Allocator>
59 bool operator==(const basic_string<charT,traits,Allocator>& lhs,
60 const charT* rhs);
61 template<class charT, class traits, class Allocator>
62 bool operator!=(const basic_string<charT,traits,Allocator>& lhs,
63 const basic_string<charT,traits,Allocator>& rhs);
64 template<class charT, class traits, class Allocator>
65 bool operator!=(const charT* lhs,
66 const basic_string<charT,traits,Allocator>& rhs);
67 template<class charT, class traits, class Allocator>
68 bool operator!=(const basic_string<charT,traits,Allocator>& lhs,
69 const charT* rhs);
71 template<class charT, class traits, class Allocator>
72 bool operator< (const basic_string<charT,traits,Allocator>& lhs,
73 const basic_string<charT,traits,Allocator>& rhs);
74 template<class charT, class traits, class Allocator>
75 bool operator< (const basic_string<charT,traits,Allocator>& lhs,
76 const charT* rhs);
77 template<class charT, class traits, class Allocator>
78 bool operator< (const charT* lhs,
79 const basic_string<charT,traits,Allocator>& rhs);
80 template<class charT, class traits, class Allocator>
81 bool operator> (const basic_string<charT,traits,Allocator>& lhs,
82 const basic_string<charT,traits,Allocator>& rhs);
83 template<class charT, class traits, class Allocator>
84 bool operator> (const basic_string<charT,traits,Allocator>& lhs,
85 const charT* rhs);
86 template<class charT, class traits, class Allocator>
87 bool operator> (const charT* lhs,
88 const basic_string<charT,traits,Allocator>& rhs);
90 template<class charT, class traits, class Allocator>
91 bool operator<=(const basic_string<charT,traits,Allocator>& lhs,
92 const basic_string<charT,traits,Allocator>& rhs);
93 template<class charT, class traits, class Allocator>
94 bool operator<=(const basic_string<charT,traits,Allocator>& lhs,
95 const charT* rhs);
96 template<class charT, class traits, class Allocator>
97 bool operator<=(const charT* lhs,
98 const basic_string<charT,traits,Allocator>& rhs);
99 template<class charT, class traits, class Allocator>
100 bool operator>=(const basic_string<charT,traits,Allocator>& lhs,
101 const basic_string<charT,traits,Allocator>& rhs);
102 template<class charT, class traits, class Allocator>
103 bool operator>=(const basic_string<charT,traits,Allocator>& lhs,
104 const charT* rhs);
105 template<class charT, class traits, class Allocator>
106 bool operator>=(const charT* lhs,
107 const basic_string<charT,traits,Allocator>& rhs);
109 // lib.string.special:
110 template<class charT, class traits, class Allocator>
111 void swap(basic_string<charT,traits,Allocator>& lhs,
112 basic_string<charT,traits,Allocator>& rhs);
114 template<class charT, class traits, class Allocator>
115 basic_istream<charT,traits>&
116 operator>>(basic_istream<charT,traits>& is,
117 basic_string<charT,traits,Allocator>& str);
118 template<class charT, class traits, class Allocator>
119 basic_ostream<charT, traits>&
120 operator<<(basic_ostream<charT, traits>& os,
121 const basic_string<charT,traits,Allocator>& str);
122 template<class charT, class traits, class Allocator>
123 basic_istream<charT,traits>&
124 getline(basic_istream<charT,traits>& is,
125 basic_string<charT,traits,Allocator>& str,
126 charT delim);
127 template<class charT, class traits, class Allocator>
128 basic_istream<charT,traits>&
129 getline(basic_istream<charT,traits>& is,
130 basic_string<charT,traits,Allocator>& str);
132 typedef basic_string<char> string;
133 typedef basic_string<wchar_t> wstring;