1 // { dg-options "-std=gnu++11" }
2 // { dg-do compile { target c++11_only } }
3 // { dg-require-normal-namespace "" }
5 // Copyright (C) 2016-2022 Free Software Foundation, Inc.
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)
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.
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/>.
26 // C++11 24.4.4, iterator operations:
27 template <class InputIterator
, class Distance
>
29 advance(InputIterator
& i
, Distance n
);
31 template <class InputIterator
>
32 typename iterator_traits
<InputIterator
>::difference_type
33 distance(InputIterator first
, InputIterator last
);
35 template<class ForwardIterator
>
37 next(ForwardIterator x
,
38 typename iterator_traits
<ForwardIterator
>::difference_type
);
40 template<class BidirectionalIterator
>
42 prev(BidirectionalIterator x
,
43 typename iterator_traits
<BidirectionalIterator
>::difference_type
);
45 // C++11 24.5, Iterator adaptors:
46 template <class Iterator
> class reverse_iterator
;
48 template <class Iterator1
, class Iterator2
>
49 bool operator==(const reverse_iterator
<Iterator1
>& x
,
50 const reverse_iterator
<Iterator2
>& y
);
52 template <class Iterator1
, class Iterator2
>
53 bool operator<(const reverse_iterator
<Iterator1
>& x
,
54 const reverse_iterator
<Iterator2
>& y
);
56 template <class Iterator1
, class Iterator2
>
57 bool operator!=(const reverse_iterator
<Iterator1
>& x
,
58 const reverse_iterator
<Iterator2
>& y
);
60 template <class Iterator1
, class Iterator2
>
61 bool operator>(const reverse_iterator
<Iterator1
>& x
,
62 const reverse_iterator
<Iterator2
>& y
);
64 template <class Iterator1
, class Iterator2
>
65 bool operator>=(const reverse_iterator
<Iterator1
>& x
,
66 const reverse_iterator
<Iterator2
>& y
);
68 template <class Iterator1
, class Iterator2
>
69 bool operator<=(const reverse_iterator
<Iterator1
>& x
,
70 const reverse_iterator
<Iterator2
>& y
);
72 template <class Iterator1
, class Iterator2
>
74 operator-(const reverse_iterator
<Iterator1
>& x
,
75 const reverse_iterator
<Iterator2
>& y
)
76 -> decltype(x
.base() - y
.base());
78 template <class Iterator
>
79 reverse_iterator
<Iterator
>
80 operator+(typename reverse_iterator
<Iterator
>::difference_type n
,
81 const reverse_iterator
<Iterator
>& x
);
83 template <class Container
> class back_insert_iterator
;
85 template <class Container
>
86 back_insert_iterator
<Container
> back_inserter(Container
& x
);
88 template <class Container
> class front_insert_iterator
;
90 template <class Container
>
91 front_insert_iterator
<Container
> front_inserter(Container
& x
);
93 template <class Container
> class insert_iterator
;
95 template <class Container
, class Iterator
>
96 insert_iterator
<Container
> inserter(Container
& x
, Iterator i
);
98 template <class Iterator
> class move_iterator
;
100 template <class Iterator1
, class Iterator2
>
101 bool operator==(const move_iterator
<Iterator1
>& x
,
102 const move_iterator
<Iterator2
>& y
);
104 template <class Iterator1
, class Iterator2
>
105 bool operator!=(const move_iterator
<Iterator1
>& x
,
106 const move_iterator
<Iterator2
>& y
);
108 template <class Iterator1
, class Iterator2
>
109 bool operator<(const move_iterator
<Iterator1
>& x
,
110 const move_iterator
<Iterator2
>& y
);
112 template <class Iterator1
, class Iterator2
>
113 bool operator<=(const move_iterator
<Iterator1
>& x
,
114 const move_iterator
<Iterator2
>& y
);
116 template <class Iterator1
, class Iterator2
>
117 bool operator>(const move_iterator
<Iterator1
>& x
,
118 const move_iterator
<Iterator2
>& y
);
120 template <class Iterator1
, class Iterator2
>
121 bool operator>=(const move_iterator
<Iterator1
>& x
,
122 const move_iterator
<Iterator2
>& y
);
124 template <class Iterator1
, class Iterator2
>
125 auto operator-(const move_iterator
<Iterator1
>& x
,
126 const move_iterator
<Iterator2
>& y
)
127 -> decltype(x
.base() - y
.base());
129 template <class Iterator
>
130 move_iterator
<Iterator
>
131 operator+(typename move_iterator
<Iterator
>::difference_type
,
132 const move_iterator
<Iterator
>&);
134 template <class Iterator
>
135 move_iterator
<Iterator
> make_move_iterator(const Iterator
&);
137 // 24.6, stream iterators:
138 template <class T
, class charT
, class traits
, class Distance
>
139 class istream_iterator
;
141 template <class T
, class charT
, class traits
, class Distance
>
142 bool operator==(const istream_iterator
<T
,charT
,traits
,Distance
>& x
,
143 const istream_iterator
<T
,charT
,traits
,Distance
>& y
);
145 template <class T
, class charT
, class traits
, class Distance
>
146 bool operator!=(const istream_iterator
<T
,charT
,traits
,Distance
>& x
,
147 const istream_iterator
<T
,charT
,traits
,Distance
>& y
);
149 template <class T
, class charT
, class traits
>
150 class ostream_iterator
;
152 template<class charT
, class traits
>
153 class istreambuf_iterator
;
155 template <class charT
, class traits
>
157 operator==(const istreambuf_iterator
<charT
,traits
>&,
158 const istreambuf_iterator
<charT
,traits
>&);
160 template <class charT
, class traits
>
161 bool operator!=(const istreambuf_iterator
<charT
,traits
>&,
162 const istreambuf_iterator
<charT
,traits
>&);
164 template <class charT
, class traits
>
165 class ostreambuf_iterator
;