Debian Codegraph @

libstdc++-v3/testsuite/23_containers/headers/vector/synopsis.cc

raw
1 // { dg-do compile }
2 // { dg-require-normal-mode "" }
3 // { dg-require-normal-namespace "" }
4
5 // Copyright (C) 2007-2025 Free Software Foundation, Inc.
6 //
7 // This file is part of the GNU ISO C++ Library. This library is free
8 // software; you can redistribute it and/or modify it under the
9 // terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 3, or (at your option)
11 // any later version.
12
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17
18 // You should have received a copy of the GNU General Public License along
19 // with this library; see the file COPYING3. If not see
20 // <http://www.gnu.org/licenses/>.
21
22 #include <vector>
23
24 #if __cplusplus >= 201103L
25 # define NOTHROW(X) noexcept(X)
26 #else
27 # define NOTHROW(X)
28 #endif
29
30 #if __cplusplus >= 202002L
31 # define CONSTEXPR constexpr
32 #else
33 # define CONSTEXPR
34 #endif
35
36 namespace std {
37 template <class T, class Allocator> class vector;
38
39 template <class T, class Allocator>
40 CONSTEXPR
41 bool operator==(const vector<T,Allocator>& x,
42 const vector<T,Allocator>& y);
43
44 #if __cplusplus < 202002L
45 template <class T, class Allocator>
46 bool operator< (const vector<T,Allocator>& x,
47 const vector<T,Allocator>& y);
48
49 template <class T, class Allocator>
50 bool operator!=(const vector<T,Allocator>& x,
51 const vector<T,Allocator>& y);
52
53 template <class T, class Allocator>
54 bool operator> (const vector<T,Allocator>& x,
55 const vector<T,Allocator>& y);
56
57 template <class T, class Allocator>
58 bool operator>=(const vector<T,Allocator>& x,
59 const vector<T,Allocator>& y);
60
61 template <class T, class Allocator>
62 bool operator<=(const vector<T,Allocator>& x,
63 const vector<T,Allocator>& y);
64 #endif
65
66 template <class T, class Allocator>
67 CONSTEXPR
68 void swap(vector<T,Allocator>& x, vector<T,Allocator>& y)
69 NOTHROW(noexcept(x.swap(y)));
70
71 template <class Allocator> class vector<bool,Allocator>;
72
73 template <class Allocator>
74 CONSTEXPR
75 bool operator==(const vector<bool,Allocator>& x,
76 const vector<bool,Allocator>& y);
77
78 #if __cplusplus < 202002L
79 template <class Allocator>
80 bool operator< (const vector<bool,Allocator>& x,
81 const vector<bool,Allocator>& y);
82
83 template <class Allocator>
84 bool operator!=(const vector<bool,Allocator>& x,
85 const vector<bool,Allocator>& y);
86
87 template <class Allocator>
88 bool operator> (const vector<bool,Allocator>& x,
89 const vector<bool,Allocator>& y);
90
91 template <class Allocator>
92 bool operator>=(const vector<bool,Allocator>& x,
93 const vector<bool,Allocator>& y);
94
95 template <class Allocator>
96 bool operator<=(const vector<bool,Allocator>& x,
97 const vector<bool,Allocator>& y);
98 #endif
99
100 template <class Allocator>
101 CONSTEXPR
102 void swap(vector<bool,Allocator>& x, vector<bool,Allocator>& y);
103 }