]>
Commit | Line | Data |
---|---|---|
b405d54f JW |
1 | // { dg-options "-std=gnu++17" } |
2 | // { dg-do compile } | |
8468bfe8 | 3 | // { dg-require-normal-namespace "" } |
b405d54f | 4 | |
8d9254fc | 5 | // Copyright (C) 2016-2020 Free Software Foundation, Inc. |
b405d54f JW |
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 <iterator> | |
23 | ||
24 | namespace std { | |
25 | ||
26 | // C++17 24.4.3, iterator operations: | |
27 | template <class InputIterator, class Distance> | |
28 | constexpr void | |
29 | advance(InputIterator& i, Distance n); | |
30 | ||
31 | template <class InputIterator> | |
32 | constexpr typename iterator_traits<InputIterator>::difference_type | |
33 | distance(InputIterator first, InputIterator last); | |
34 | ||
35 | template <class ForwardIterator> | |
36 | constexpr ForwardIterator | |
37 | next(ForwardIterator x, | |
38 | typename iterator_traits<ForwardIterator>::difference_type); | |
39 | ||
40 | template <class BidirectionalIterator> | |
41 | constexpr BidirectionalIterator | |
42 | prev(BidirectionalIterator x, | |
43 | typename iterator_traits<BidirectionalIterator>::difference_type); | |
44 | ||
45 | // C++17 24.5, iterator adaptors: | |
46 | template <class Iterator> class reverse_iterator; | |
47 | ||
48 | template <class Iterator1, class Iterator2> | |
49 | constexpr | |
50 | bool operator==(const reverse_iterator<Iterator1>& x, | |
51 | const reverse_iterator<Iterator2>& y); | |
52 | ||
53 | template <class Iterator1, class Iterator2> | |
54 | constexpr | |
55 | bool operator<(const reverse_iterator<Iterator1>& x, | |
56 | const reverse_iterator<Iterator2>& y); | |
57 | ||
58 | template <class Iterator1, class Iterator2> | |
59 | constexpr | |
60 | bool operator!=(const reverse_iterator<Iterator1>& x, | |
61 | const reverse_iterator<Iterator2>& y); | |
62 | ||
63 | template <class Iterator1, class Iterator2> | |
64 | constexpr | |
65 | bool operator>(const reverse_iterator<Iterator1>& x, | |
66 | const reverse_iterator<Iterator2>& y); | |
67 | ||
68 | template <class Iterator1, class Iterator2> | |
69 | constexpr | |
70 | bool operator>=(const reverse_iterator<Iterator1>& x, | |
71 | const reverse_iterator<Iterator2>& y); | |
72 | ||
73 | template <class Iterator1, class Iterator2> | |
74 | constexpr | |
75 | bool operator<=(const reverse_iterator<Iterator1>& x, | |
76 | const reverse_iterator<Iterator2>& y); | |
77 | ||
78 | template <class Iterator1, class Iterator2> | |
79 | constexpr auto | |
80 | operator-(const reverse_iterator<Iterator1>& x, | |
81 | const reverse_iterator<Iterator2>& y) | |
82 | -> decltype(x.base() - y.base()); | |
83 | ||
84 | template <class Iterator> | |
85 | constexpr reverse_iterator<Iterator> | |
86 | operator+(typename reverse_iterator<Iterator>::difference_type n, | |
87 | const reverse_iterator<Iterator>& x); | |
88 | ||
89 | template <class Iterator> | |
90 | constexpr reverse_iterator<Iterator> make_reverse_iterator(const Iterator&); | |
91 | ||
92 | template <class Container> class back_insert_iterator; | |
93 | ||
94 | template <class Container> | |
95 | back_insert_iterator<Container> back_inserter(Container& x); | |
96 | ||
97 | template <class Container> class front_insert_iterator; | |
98 | ||
99 | template <class Container> | |
100 | front_insert_iterator<Container> front_inserter(Container& x); | |
101 | ||
102 | template <class Container> class insert_iterator; | |
103 | ||
104 | template <class Container, class Iterator> | |
105 | insert_iterator<Container> inserter(Container& x, Iterator i); | |
106 | ||
107 | template <class Iterator> class move_iterator; | |
108 | ||
109 | template <class Iterator1, class Iterator2> | |
110 | constexpr | |
111 | bool operator==(const move_iterator<Iterator1>& x, | |
112 | const move_iterator<Iterator2>& y); | |
113 | ||
114 | template <class Iterator1, class Iterator2> | |
115 | constexpr | |
116 | bool operator!=(const move_iterator<Iterator1>& x, | |
117 | const move_iterator<Iterator2>& y); | |
118 | ||
119 | template <class Iterator1, class Iterator2> | |
120 | constexpr | |
121 | bool operator<(const move_iterator<Iterator1>& x, | |
122 | const move_iterator<Iterator2>& y); | |
123 | ||
124 | template <class Iterator1, class Iterator2> | |
125 | constexpr | |
126 | bool operator<=(const move_iterator<Iterator1>& x, | |
127 | const move_iterator<Iterator2>& y); | |
128 | ||
129 | template <class Iterator1, class Iterator2> | |
130 | constexpr | |
131 | bool operator>(const move_iterator<Iterator1>& x, | |
132 | const move_iterator<Iterator2>& y); | |
133 | ||
134 | template <class Iterator1, class Iterator2> | |
135 | constexpr | |
136 | bool operator>=(const move_iterator<Iterator1>& x, | |
137 | const move_iterator<Iterator2>& y); | |
138 | ||
139 | template <class Iterator1, class Iterator2> | |
140 | constexpr | |
141 | auto operator-(const move_iterator<Iterator1>& x, | |
142 | const move_iterator<Iterator2>& y) | |
143 | -> decltype(x.base() - y.base()); | |
144 | ||
145 | template <class Iterator> | |
146 | constexpr move_iterator<Iterator> | |
147 | operator+(typename move_iterator<Iterator>::difference_type, | |
148 | const move_iterator<Iterator>&); | |
149 | ||
150 | template <class Iterator> | |
151 | constexpr move_iterator<Iterator> make_move_iterator(const Iterator&); | |
152 | ||
153 | // 24.6, stream iterators: | |
154 | template <class T, class charT, class traits, class Distance> | |
155 | class istream_iterator; | |
156 | ||
157 | template <class T, class charT, class traits, class Distance> | |
158 | bool operator==(const istream_iterator<T,charT,traits,Distance>& x, | |
159 | const istream_iterator<T,charT,traits,Distance>& y); | |
160 | ||
161 | template <class T, class charT, class traits, class Distance> | |
162 | bool operator!=(const istream_iterator<T,charT,traits,Distance>& x, | |
163 | const istream_iterator<T,charT,traits,Distance>& y); | |
164 | ||
165 | template <class T, class charT, class traits> | |
166 | class ostream_iterator; | |
167 | ||
168 | template<class charT, class traits> | |
169 | class istreambuf_iterator; | |
170 | ||
171 | template <class charT, class traits> | |
172 | bool | |
173 | operator==(const istreambuf_iterator<charT,traits>&, | |
174 | const istreambuf_iterator<charT,traits>&); | |
175 | ||
176 | template <class charT, class traits> | |
177 | bool operator!=(const istreambuf_iterator<charT,traits>&, | |
178 | const istreambuf_iterator<charT,traits>&); | |
179 | ||
180 | template <class charT, class traits> | |
181 | class ostreambuf_iterator; | |
182 | } |