Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===-------------------------- iterator ----------------------------------===// |
| 3 | // |
Chandler Carruth | d201210 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef _LIBCPP_ITERATOR |
| 11 | #define _LIBCPP_ITERATOR |
| 12 | |
| 13 | /* |
| 14 | iterator synopsis |
| 15 | |
Christopher Di Bella | 490fe40 | 2021-03-23 03:55:52 +0000 | [diff] [blame] | 16 | #include <concepts> |
| 17 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 18 | namespace std |
| 19 | { |
Christopher Di Bella | e00eebc | 2021-03-23 20:48:41 +0000 | [diff] [blame] | 20 | template<class> struct incrementable_traits; // since C++20 |
Christopher Di Bella | a3a1006 | 2021-04-20 18:56:08 +0000 | [diff] [blame] | 21 | template<class T> |
| 22 | using iter_difference_t = see below; // since C++20 |
| 23 | |
Christopher Di Bella | e00eebc | 2021-03-23 20:48:41 +0000 | [diff] [blame] | 24 | template<class> struct indirectly_readable_traits; // since C++20 |
Christopher Di Bella | a3a1006 | 2021-04-20 18:56:08 +0000 | [diff] [blame] | 25 | template<class T> |
| 26 | using iter_value_t = see below; // since C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 27 | |
| 28 | template<class Iterator> |
zoecarver | 9f1e297 | 2021-04-20 08:50:11 -0400 | [diff] [blame] | 29 | struct iterator_traits; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 30 | |
| 31 | template<class T> |
zoecarver | 9f1e297 | 2021-04-20 08:50:11 -0400 | [diff] [blame] | 32 | requires is_object_v<T> // since C++20 |
| 33 | struct iterator_traits<T*>; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 34 | |
Christopher Di Bella | 875636f | 2021-04-04 05:12:46 +0000 | [diff] [blame] | 35 | template<dereferenceable T> |
| 36 | using iter_reference_t = decltype(*declval<T&>()); |
| 37 | |
Louis Dionne | ca989a5 | 2021-04-20 14:40:43 -0400 | [diff] [blame] | 38 | namespace ranges::inline unspecified { |
| 39 | inline constexpr unspecified iter_move = unspecified; // since C++20, nodiscard as an extension |
| 40 | }} |
| 41 | |
| 42 | template<dereferenceable T> |
| 43 | requires ... |
| 44 | using iter_rvalue_reference_t = decltype(ranges::iter_move(declval<T&>())); // since C++20 |
| 45 | |
Louis Dionne | 463afb8 | 2021-04-22 11:05:30 -0400 | [diff] [blame] | 46 | // [iterator.concepts], iterator concepts |
| 47 | // [iterator.concept.readable], concept indirectly_readable |
| 48 | template<class In> |
Louis Dionne | 170a03c | 2021-04-28 15:02:08 -0400 | [diff] [blame] | 49 | concept indirectly_readable = see below; // since C++20 |
| 50 | |
| 51 | template<indirectly_readable T> |
| 52 | using iter_common_reference_t = |
| 53 | common_reference_t<iter_reference_t<T>, iter_value_t<T>&>; // since C++20 |
Louis Dionne | 463afb8 | 2021-04-22 11:05:30 -0400 | [diff] [blame] | 54 | |
| 55 | // [iterator.concept.writable], concept indirectly_writable |
| 56 | template<class Out, class T> |
| 57 | concept indirectly_writable = see below; // since C++20 |
| 58 | |
Mark de Wever | 6639f42 | 2021-04-26 17:53:20 +0200 | [diff] [blame] | 59 | // [iterator.concept.winc], concept weakly_incrementable |
Christopher Di Bella | 54ffc18 | 2021-04-23 18:22:55 -0700 | [diff] [blame] | 60 | template<class I> |
| 61 | concept weakly_incrementable = see below; // since C++20 |
| 62 | |
| 63 | // [iterator.concept.inc], concept incrementable |
| 64 | template<class I> |
| 65 | concept incrementable = see below; // since C++20 |
| 66 | |
Mark de Wever | 6639f42 | 2021-04-26 17:53:20 +0200 | [diff] [blame] | 67 | // [iterator.concept.iterator], concept input_or_output_iterator |
Christopher Di Bella | 0ef5228 | 2021-04-09 02:10:32 +0000 | [diff] [blame] | 68 | template<class I> |
| 69 | concept input_or_output_iterator = see below; // since C++20 |
| 70 | |
Mark de Wever | 6639f42 | 2021-04-26 17:53:20 +0200 | [diff] [blame] | 71 | // [iterator.concept.sentinel], concept sentinel_for |
Christopher Di Bella | 0ef5228 | 2021-04-09 02:10:32 +0000 | [diff] [blame] | 72 | template<class S, class I> |
| 73 | concept sentinel_for = see below; // since C++20 |
| 74 | |
zoecarver | 11391bc | 2021-04-26 09:35:47 -0700 | [diff] [blame] | 75 | // [iterator.concept.sizedsentinel], concept sized_sentinel_for |
| 76 | template<class S, class I> |
| 77 | inline constexpr bool disable_sized_sentinel_for = false; |
| 78 | |
| 79 | template<class S, class I> |
| 80 | concept sized_sentinel_for = see below; |
| 81 | |
Christopher Di Bella | 8250c63 | 2021-04-11 19:04:52 +0000 | [diff] [blame] | 82 | // [iterator.concept.input], concept input_iterator |
| 83 | template<class I> |
| 84 | concept input_iterator = see below; // since C++20 |
| 85 | |
Christopher Di Bella | 8f1370d | 2021-04-11 22:11:03 +0000 | [diff] [blame] | 86 | // [iterator.concept.forward], concept forward_iterator |
| 87 | template<class I> |
| 88 | concept forward_iterator = see below; // since C++20 |
| 89 | |
Christopher Di Bella | 10a3147 | 2021-04-12 01:16:45 +0000 | [diff] [blame] | 90 | // [iterator.concept.bidir], concept bidirectional_iterator |
| 91 | template<class I> |
| 92 | concept bidirectional_iterator = see below; // since C++20 |
| 93 | |
zoecarver | 21da57e | 2021-04-23 17:11:44 -0700 | [diff] [blame] | 94 | // [iterator.concept.random.access], concept random_access_iterator |
| 95 | template<class I> |
| 96 | concept random_access_iterator = see below; // since C++20 |
| 97 | |
Louis Dionne | 170a03c | 2021-04-28 15:02:08 -0400 | [diff] [blame] | 98 | // [indirectcallable] |
| 99 | // [indirectcallable.indirectinvocable] |
| 100 | template<class F, class I> |
| 101 | concept indirectly_unary_invocable = see below; // since C++20 |
| 102 | |
| 103 | template<class F, class I> |
| 104 | concept indirectly_regular_unary_invocable = see below; // since C++20 |
| 105 | |
| 106 | template<class F, class I> |
| 107 | concept indirect_unary_predicate = see below; // since C++20 |
| 108 | |
| 109 | template<class F, class I1, class I2> |
| 110 | concept indirect_binary_predicate = see below; // since C++20 |
| 111 | |
| 112 | template<class F, class I1, class I2 = I1> |
| 113 | concept indirect_equivalence_relation = see below; // since C++20 |
| 114 | |
| 115 | template<class F, class I1, class I2 = I1> |
| 116 | concept indirect_strict_weak_order = see below; // since C++20 |
| 117 | |
| 118 | template<class F, class... Is> |
| 119 | using indirect_result_t = see below; // since C++20 |
| 120 | |
| 121 | // [projected], projected |
| 122 | template<indirectly_readable I, indirectly_regular_unary_invocable<I> Proj> |
| 123 | struct projected; // since C++20 |
| 124 | |
| 125 | template<weakly_incrementable I, indirectly_regular_unary_invocable<I> Proj> |
| 126 | struct incrementable_traits<projected<I, Proj>>; // since C++20 |
| 127 | |
zoecarver | 7e38f80 | 2021-05-17 10:30:12 -0700 | [diff] [blame] | 128 | // [alg.req.ind.move], concept indirectly_movable |
| 129 | template<class In, class Out> |
| 130 | concept indirectly_movable = see below; // since C++20 |
| 131 | |
| 132 | template<class In, class Out> |
| 133 | concept indirectly_movable_storable = see below; // since C++20 |
| 134 | |
zoecarver | e0d9808 | 2021-07-01 11:58:54 -0700 | [diff] [blame] | 135 | // [alg.req.ind.swap], concept indirectly_swappable |
| 136 | template<class I1, class I2 = I1> |
| 137 | concept indirectly_swappable = see below; // since C++20 |
| 138 | |
zoecarver | 6eb71a9 | 2021-05-27 09:23:19 -0700 | [diff] [blame] | 139 | template<input_or_output_iterator I, sentinel_for<I> S> |
| 140 | requires (!same_as<I, S> && copyable<I>) |
| 141 | class common_iterator; // since C++20 |
| 142 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 143 | template<class Category, class T, class Distance = ptrdiff_t, |
| 144 | class Pointer = T*, class Reference = T&> |
Louis Dionne | 8762e2b | 2021-05-25 18:15:58 -0400 | [diff] [blame] | 145 | struct iterator // deprecated in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 146 | { |
| 147 | typedef T value_type; |
| 148 | typedef Distance difference_type; |
| 149 | typedef Pointer pointer; |
| 150 | typedef Reference reference; |
| 151 | typedef Category iterator_category; |
| 152 | }; |
| 153 | |
| 154 | struct input_iterator_tag {}; |
| 155 | struct output_iterator_tag {}; |
| 156 | struct forward_iterator_tag : public input_iterator_tag {}; |
| 157 | struct bidirectional_iterator_tag : public forward_iterator_tag {}; |
| 158 | struct random_access_iterator_tag : public bidirectional_iterator_tag {}; |
| 159 | |
Marshall Clow | 75468e7 | 2017-05-17 18:51:36 +0000 | [diff] [blame] | 160 | // 27.4.3, iterator operations |
Louis Dionne | 4576866 | 2020-06-08 16:16:01 -0400 | [diff] [blame] | 161 | template <class InputIterator, class Distance> // constexpr in C++17 |
| 162 | constexpr void advance(InputIterator& i, Distance n); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 163 | |
Marshall Clow | 75468e7 | 2017-05-17 18:51:36 +0000 | [diff] [blame] | 164 | template <class InputIterator> // constexpr in C++17 |
| 165 | constexpr typename iterator_traits<InputIterator>::difference_type |
| 166 | distance(InputIterator first, InputIterator last); |
| 167 | |
| 168 | template <class InputIterator> // constexpr in C++17 |
| 169 | constexpr InputIterator next(InputIterator x, |
| 170 | typename iterator_traits<InputIterator>::difference_type n = 1); |
| 171 | |
| 172 | template <class BidirectionalIterator> // constexpr in C++17 |
| 173 | constexpr BidirectionalIterator prev(BidirectionalIterator x, |
Louis Dionne | 173f29e | 2019-05-29 16:01:36 +0000 | [diff] [blame] | 174 | typename iterator_traits<BidirectionalIterator>::difference_type n = 1); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 175 | |
Christopher Di Bella | c6ead65 | 2021-05-05 07:14:08 +0000 | [diff] [blame] | 176 | // [range.iter.ops], range iterator operations |
| 177 | namespace ranges { |
| 178 | // [range.iter.op.advance], ranges::advance |
| 179 | template<input_or_output_iterator I> |
| 180 | constexpr void advance(I& i, iter_difference_t<I> n); // since C++20 |
| 181 | template<input_or_output_iterator I, sentinel_for<I> S> |
| 182 | constexpr void advance(I& i, S bound); // since C++20 |
| 183 | template<input_or_output_iterator I, sentinel_for<I> S> |
| 184 | constexpr iter_difference_t<I> advance(I& i, iter_difference_t<I> n, S bound); // since C++20 |
| 185 | } |
| 186 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 187 | template <class Iterator> |
| 188 | class reverse_iterator |
Louis Dionne | 8762e2b | 2021-05-25 18:15:58 -0400 | [diff] [blame] | 189 | : public iterator<typename iterator_traits<Iterator>::iterator_category, // until C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 190 | typename iterator_traits<Iterator>::value_type, |
| 191 | typename iterator_traits<Iterator>::difference_type, |
| 192 | typename iterator_traits<Iterator>::pointer, |
| 193 | typename iterator_traits<Iterator>::reference> |
| 194 | { |
| 195 | protected: |
| 196 | Iterator current; |
| 197 | public: |
| 198 | typedef Iterator iterator_type; |
| 199 | typedef typename iterator_traits<Iterator>::difference_type difference_type; |
| 200 | typedef typename iterator_traits<Iterator>::reference reference; |
| 201 | typedef typename iterator_traits<Iterator>::pointer pointer; |
Howard Hinnant | 3b6579a | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 202 | |
Marshall Clow | 5ace554 | 2016-10-19 15:12:50 +0000 | [diff] [blame] | 203 | constexpr reverse_iterator(); |
| 204 | constexpr explicit reverse_iterator(Iterator x); |
| 205 | template <class U> constexpr reverse_iterator(const reverse_iterator<U>& u); |
| 206 | template <class U> constexpr reverse_iterator& operator=(const reverse_iterator<U>& u); |
| 207 | constexpr Iterator base() const; |
| 208 | constexpr reference operator*() const; |
| 209 | constexpr pointer operator->() const; |
| 210 | constexpr reverse_iterator& operator++(); |
| 211 | constexpr reverse_iterator operator++(int); |
| 212 | constexpr reverse_iterator& operator--(); |
| 213 | constexpr reverse_iterator operator--(int); |
| 214 | constexpr reverse_iterator operator+ (difference_type n) const; |
| 215 | constexpr reverse_iterator& operator+=(difference_type n); |
| 216 | constexpr reverse_iterator operator- (difference_type n) const; |
| 217 | constexpr reverse_iterator& operator-=(difference_type n); |
| 218 | constexpr reference operator[](difference_type n) const; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 219 | }; |
| 220 | |
| 221 | template <class Iterator1, class Iterator2> |
Marshall Clow | 5ace554 | 2016-10-19 15:12:50 +0000 | [diff] [blame] | 222 | constexpr bool // constexpr in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 223 | operator==(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y); |
| 224 | |
| 225 | template <class Iterator1, class Iterator2> |
Marshall Clow | 5ace554 | 2016-10-19 15:12:50 +0000 | [diff] [blame] | 226 | constexpr bool // constexpr in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 227 | operator<(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y); |
| 228 | |
| 229 | template <class Iterator1, class Iterator2> |
Marshall Clow | 5ace554 | 2016-10-19 15:12:50 +0000 | [diff] [blame] | 230 | constexpr bool // constexpr in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 231 | operator!=(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y); |
| 232 | |
| 233 | template <class Iterator1, class Iterator2> |
Marshall Clow | 5ace554 | 2016-10-19 15:12:50 +0000 | [diff] [blame] | 234 | constexpr bool // constexpr in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 235 | operator>(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y); |
| 236 | |
| 237 | template <class Iterator1, class Iterator2> |
Marshall Clow | 5ace554 | 2016-10-19 15:12:50 +0000 | [diff] [blame] | 238 | constexpr bool // constexpr in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 239 | operator>=(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y); |
| 240 | |
| 241 | template <class Iterator1, class Iterator2> |
Marshall Clow | 5ace554 | 2016-10-19 15:12:50 +0000 | [diff] [blame] | 242 | constexpr bool // constexpr in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 243 | operator<=(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y); |
| 244 | |
| 245 | template <class Iterator1, class Iterator2> |
Marshall Clow | 5ace554 | 2016-10-19 15:12:50 +0000 | [diff] [blame] | 246 | constexpr auto |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 247 | operator-(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y) |
Marshall Clow | 5ace554 | 2016-10-19 15:12:50 +0000 | [diff] [blame] | 248 | -> decltype(__y.base() - __x.base()); // constexpr in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 249 | |
| 250 | template <class Iterator> |
Marshall Clow | 5ace554 | 2016-10-19 15:12:50 +0000 | [diff] [blame] | 251 | constexpr reverse_iterator<Iterator> |
Louis Dionne | 173f29e | 2019-05-29 16:01:36 +0000 | [diff] [blame] | 252 | operator+(typename reverse_iterator<Iterator>::difference_type n, |
Marshall Clow | 5ace554 | 2016-10-19 15:12:50 +0000 | [diff] [blame] | 253 | const reverse_iterator<Iterator>& x); // constexpr in C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 254 | |
Marshall Clow | 5ace554 | 2016-10-19 15:12:50 +0000 | [diff] [blame] | 255 | template <class Iterator> |
| 256 | constexpr reverse_iterator<Iterator> make_reverse_iterator(Iterator i); // C++14, constexpr in C++17 |
Marshall Clow | 6dbbdc9 | 2014-03-03 01:24:04 +0000 | [diff] [blame] | 257 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 258 | template <class Container> |
| 259 | class back_insert_iterator |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 260 | : public iterator<output_iterator_tag, void, void, void, void> // until C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 261 | { |
| 262 | protected: |
| 263 | Container* container; |
| 264 | public: |
| 265 | typedef Container container_type; |
| 266 | typedef void value_type; |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 267 | typedef void difference_type; // until C++20 |
| 268 | typedef ptrdiff_t difference_type; // since C++20 |
Eric Fiselier | 9aeea87 | 2016-06-30 04:40:50 +0000 | [diff] [blame] | 269 | typedef void reference; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 270 | typedef void pointer; |
| 271 | |
Arthur O'Dwyer | 20638cc | 2021-02-09 19:12:16 -0500 | [diff] [blame] | 272 | explicit back_insert_iterator(Container& x); // constexpr in C++20 |
| 273 | back_insert_iterator& operator=(const typename Container::value_type& value); // constexpr in C++20 |
| 274 | back_insert_iterator& operator*(); // constexpr in C++20 |
| 275 | back_insert_iterator& operator++(); // constexpr in C++20 |
| 276 | back_insert_iterator operator++(int); // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 277 | }; |
| 278 | |
Arthur O'Dwyer | 20638cc | 2021-02-09 19:12:16 -0500 | [diff] [blame] | 279 | template <class Container> back_insert_iterator<Container> back_inserter(Container& x); // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 280 | |
| 281 | template <class Container> |
| 282 | class front_insert_iterator |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 283 | : public iterator<output_iterator_tag, void, void, void, void> // until C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 284 | { |
| 285 | protected: |
| 286 | Container* container; |
| 287 | public: |
| 288 | typedef Container container_type; |
| 289 | typedef void value_type; |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 290 | typedef void difference_type; // until C++20 |
| 291 | typedef ptrdiff_t difference_type; // since C++20 |
Eric Fiselier | 9aeea87 | 2016-06-30 04:40:50 +0000 | [diff] [blame] | 292 | typedef void reference; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 293 | typedef void pointer; |
| 294 | |
Arthur O'Dwyer | 20638cc | 2021-02-09 19:12:16 -0500 | [diff] [blame] | 295 | explicit front_insert_iterator(Container& x); // constexpr in C++20 |
| 296 | front_insert_iterator& operator=(const typename Container::value_type& value); // constexpr in C++20 |
| 297 | front_insert_iterator& operator*(); // constexpr in C++20 |
| 298 | front_insert_iterator& operator++(); // constexpr in C++20 |
| 299 | front_insert_iterator operator++(int); // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 300 | }; |
| 301 | |
Arthur O'Dwyer | 20638cc | 2021-02-09 19:12:16 -0500 | [diff] [blame] | 302 | template <class Container> front_insert_iterator<Container> front_inserter(Container& x); // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 303 | |
| 304 | template <class Container> |
| 305 | class insert_iterator |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 306 | : public iterator<output_iterator_tag, void, void, void, void> // until C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 307 | { |
| 308 | protected: |
| 309 | Container* container; |
| 310 | typename Container::iterator iter; |
| 311 | public: |
| 312 | typedef Container container_type; |
| 313 | typedef void value_type; |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 314 | typedef void difference_type; // until C++20 |
| 315 | typedef ptrdiff_t difference_type; // since C++20 |
Eric Fiselier | 9aeea87 | 2016-06-30 04:40:50 +0000 | [diff] [blame] | 316 | typedef void reference; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 317 | typedef void pointer; |
| 318 | |
Arthur O'Dwyer | 20638cc | 2021-02-09 19:12:16 -0500 | [diff] [blame] | 319 | insert_iterator(Container& x, typename Container::iterator i); // constexpr in C++20 |
| 320 | insert_iterator& operator=(const typename Container::value_type& value); // constexpr in C++20 |
| 321 | insert_iterator& operator*(); // constexpr in C++20 |
| 322 | insert_iterator& operator++(); // constexpr in C++20 |
| 323 | insert_iterator& operator++(int); // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 324 | }; |
| 325 | |
| 326 | template <class Container, class Iterator> |
Arthur O'Dwyer | 20638cc | 2021-02-09 19:12:16 -0500 | [diff] [blame] | 327 | insert_iterator<Container> inserter(Container& x, Iterator i); // constexpr in C++20 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 328 | |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 329 | template <class Iterator> |
| 330 | class move_iterator { |
| 331 | public: |
| 332 | typedef Iterator iterator_type; |
| 333 | typedef typename iterator_traits<Iterator>::difference_type difference_type; |
| 334 | typedef Iterator pointer; |
| 335 | typedef typename iterator_traits<Iterator>::value_type value_type; |
| 336 | typedef typename iterator_traits<Iterator>::iterator_category iterator_category; |
| 337 | typedef value_type&& reference; |
Louis Dionne | 173f29e | 2019-05-29 16:01:36 +0000 | [diff] [blame] | 338 | |
Marshall Clow | b5f9912 | 2016-11-02 15:30:26 +0000 | [diff] [blame] | 339 | constexpr move_iterator(); // all the constexprs are in C++17 |
| 340 | constexpr explicit move_iterator(Iterator i); |
| 341 | template <class U> |
| 342 | constexpr move_iterator(const move_iterator<U>& u); |
| 343 | template <class U> |
| 344 | constexpr move_iterator& operator=(const move_iterator<U>& u); |
| 345 | constexpr iterator_type base() const; |
| 346 | constexpr reference operator*() const; |
| 347 | constexpr pointer operator->() const; |
| 348 | constexpr move_iterator& operator++(); |
| 349 | constexpr move_iterator operator++(int); |
| 350 | constexpr move_iterator& operator--(); |
| 351 | constexpr move_iterator operator--(int); |
Louis Dionne | 173f29e | 2019-05-29 16:01:36 +0000 | [diff] [blame] | 352 | constexpr move_iterator operator+(difference_type n) const; |
| 353 | constexpr move_iterator& operator+=(difference_type n); |
| 354 | constexpr move_iterator operator-(difference_type n) const; |
| 355 | constexpr move_iterator& operator-=(difference_type n); |
Marshall Clow | b5f9912 | 2016-11-02 15:30:26 +0000 | [diff] [blame] | 356 | constexpr unspecified operator[](difference_type n) const; |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 357 | private: |
| 358 | Iterator current; // exposition only |
| 359 | }; |
| 360 | |
| 361 | template <class Iterator1, class Iterator2> |
Marshall Clow | b5f9912 | 2016-11-02 15:30:26 +0000 | [diff] [blame] | 362 | constexpr bool // constexpr in C++17 |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 363 | operator==(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y); |
| 364 | |
| 365 | template <class Iterator1, class Iterator2> |
Marshall Clow | b5f9912 | 2016-11-02 15:30:26 +0000 | [diff] [blame] | 366 | constexpr bool // constexpr in C++17 |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 367 | operator!=(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y); |
| 368 | |
| 369 | template <class Iterator1, class Iterator2> |
Marshall Clow | b5f9912 | 2016-11-02 15:30:26 +0000 | [diff] [blame] | 370 | constexpr bool // constexpr in C++17 |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 371 | operator<(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y); |
| 372 | |
| 373 | template <class Iterator1, class Iterator2> |
Marshall Clow | b5f9912 | 2016-11-02 15:30:26 +0000 | [diff] [blame] | 374 | constexpr bool // constexpr in C++17 |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 375 | operator<=(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y); |
| 376 | |
| 377 | template <class Iterator1, class Iterator2> |
Marshall Clow | b5f9912 | 2016-11-02 15:30:26 +0000 | [diff] [blame] | 378 | constexpr bool // constexpr in C++17 |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 379 | operator>(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y); |
| 380 | |
| 381 | template <class Iterator1, class Iterator2> |
Marshall Clow | b5f9912 | 2016-11-02 15:30:26 +0000 | [diff] [blame] | 382 | constexpr bool // constexpr in C++17 |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 383 | operator>=(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y); |
| 384 | |
| 385 | template <class Iterator1, class Iterator2> |
Marshall Clow | b5f9912 | 2016-11-02 15:30:26 +0000 | [diff] [blame] | 386 | constexpr auto // constexpr in C++17 |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 387 | operator-(const move_iterator<Iterator1>& x, |
| 388 | const move_iterator<Iterator2>& y) -> decltype(x.base() - y.base()); |
| 389 | |
| 390 | template <class Iterator> |
Marshall Clow | b5f9912 | 2016-11-02 15:30:26 +0000 | [diff] [blame] | 391 | constexpr move_iterator<Iterator> operator+( // constexpr in C++17 |
Louis Dionne | 173f29e | 2019-05-29 16:01:36 +0000 | [diff] [blame] | 392 | typename move_iterator<Iterator>::difference_type n, |
Marshall Clow | b5f9912 | 2016-11-02 15:30:26 +0000 | [diff] [blame] | 393 | const move_iterator<Iterator>& x); |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 394 | |
Marshall Clow | b5f9912 | 2016-11-02 15:30:26 +0000 | [diff] [blame] | 395 | template <class Iterator> // constexpr in C++17 |
| 396 | constexpr move_iterator<Iterator> make_move_iterator(const Iterator& i); |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 397 | |
zoecarver | 63f1320 | 2021-06-01 12:55:33 -0700 | [diff] [blame] | 398 | // [default.sentinel], default sentinel |
| 399 | struct default_sentinel_t; |
| 400 | inline constexpr default_sentinel_t default_sentinel{}; |
Marshall Clow | f8fec4e | 2016-07-08 16:54:47 +0000 | [diff] [blame] | 401 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 402 | template <class T, class charT = char, class traits = char_traits<charT>, class Distance = ptrdiff_t> |
| 403 | class istream_iterator |
Louis Dionne | 8762e2b | 2021-05-25 18:15:58 -0400 | [diff] [blame] | 404 | : public iterator<input_iterator_tag, T, Distance, const T*, const T&> // until C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 405 | { |
| 406 | public: |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 407 | typedef input_iterator_tag iterator_category; |
| 408 | typedef T value_type; |
| 409 | typedef Distance difference_type; |
| 410 | typedef const T* pointer; |
| 411 | typedef const T& reference; |
| 412 | |
| 413 | typedef charT char_type; |
| 414 | typedef traits traits_type; |
| 415 | typedef basic_istream<charT, traits> istream_type; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 416 | |
Marshall Clow | 0735e4e | 2015-04-16 21:36:54 +0000 | [diff] [blame] | 417 | constexpr istream_iterator(); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 418 | istream_iterator(istream_type& s); |
| 419 | istream_iterator(const istream_iterator& x); |
| 420 | ~istream_iterator(); |
| 421 | |
| 422 | const T& operator*() const; |
| 423 | const T* operator->() const; |
| 424 | istream_iterator& operator++(); |
| 425 | istream_iterator operator++(int); |
| 426 | }; |
| 427 | |
| 428 | template <class T, class charT, class traits, class Distance> |
| 429 | bool operator==(const istream_iterator<T,charT,traits,Distance>& x, |
| 430 | const istream_iterator<T,charT,traits,Distance>& y); |
| 431 | template <class T, class charT, class traits, class Distance> |
| 432 | bool operator!=(const istream_iterator<T,charT,traits,Distance>& x, |
| 433 | const istream_iterator<T,charT,traits,Distance>& y); |
| 434 | |
| 435 | template <class T, class charT = char, class traits = char_traits<charT> > |
| 436 | class ostream_iterator |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 437 | : public iterator<output_iterator_tag, void, void, void, void> // until C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 438 | { |
| 439 | public: |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 440 | typedef output_iterator_tag iterator_category; |
| 441 | typedef void value_type; |
| 442 | typedef void difference_type; // until C++20 |
| 443 | typedef ptrdiff_t difference_type; // since C++20 |
| 444 | typedef void pointer; |
| 445 | typedef void reference; |
| 446 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 447 | typedef charT char_type; |
| 448 | typedef traits traits_type; |
| 449 | typedef basic_ostream<charT,traits> ostream_type; |
| 450 | |
| 451 | ostream_iterator(ostream_type& s); |
| 452 | ostream_iterator(ostream_type& s, const charT* delimiter); |
| 453 | ostream_iterator(const ostream_iterator& x); |
| 454 | ~ostream_iterator(); |
| 455 | ostream_iterator& operator=(const T& value); |
| 456 | |
| 457 | ostream_iterator& operator*(); |
| 458 | ostream_iterator& operator++(); |
| 459 | ostream_iterator& operator++(int); |
| 460 | }; |
| 461 | |
| 462 | template<class charT, class traits = char_traits<charT> > |
| 463 | class istreambuf_iterator |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 464 | : public iterator<input_iterator_tag, charT, traits::off_type, unspecified, charT> // until C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 465 | { |
| 466 | public: |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 467 | typedef input_iterator_tag iterator_category; |
| 468 | typedef charT value_type; |
| 469 | typedef traits::off_type difference_type; |
| 470 | typedef unspecified pointer; |
| 471 | typedef charT reference; |
| 472 | |
| 473 | typedef charT char_type; |
| 474 | typedef traits traits_type; |
| 475 | typedef traits::int_type int_type; |
| 476 | typedef basic_streambuf<charT, traits> streambuf_type; |
| 477 | typedef basic_istream<charT, traits> istream_type; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 478 | |
Howard Hinnant | 011138d | 2012-07-20 19:36:34 +0000 | [diff] [blame] | 479 | istreambuf_iterator() noexcept; |
| 480 | istreambuf_iterator(istream_type& s) noexcept; |
| 481 | istreambuf_iterator(streambuf_type* s) noexcept; |
| 482 | istreambuf_iterator(a-private-type) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 483 | |
| 484 | charT operator*() const; |
| 485 | pointer operator->() const; |
| 486 | istreambuf_iterator& operator++(); |
| 487 | a-private-type operator++(int); |
| 488 | |
| 489 | bool equal(const istreambuf_iterator& b) const; |
| 490 | }; |
| 491 | |
| 492 | template <class charT, class traits> |
| 493 | bool operator==(const istreambuf_iterator<charT,traits>& a, |
| 494 | const istreambuf_iterator<charT,traits>& b); |
| 495 | template <class charT, class traits> |
| 496 | bool operator!=(const istreambuf_iterator<charT,traits>& a, |
| 497 | const istreambuf_iterator<charT,traits>& b); |
| 498 | |
| 499 | template <class charT, class traits = char_traits<charT> > |
| 500 | class ostreambuf_iterator |
Louis Dionne | 8762e2b | 2021-05-25 18:15:58 -0400 | [diff] [blame] | 501 | : public iterator<output_iterator_tag, void, void, void, void> // until C++17 |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 502 | { |
| 503 | public: |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 504 | typedef output_iterator_tag iterator_category; |
| 505 | typedef void value_type; |
| 506 | typedef void difference_type; // until C++20 |
| 507 | typedef ptrdiff_t difference_type; // since C++20 |
| 508 | typedef void pointer; |
| 509 | typedef void reference; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 510 | |
Louis Dionne | 3402c3c | 2021-05-27 12:56:12 -0400 | [diff] [blame] | 511 | typedef charT char_type; |
| 512 | typedef traits traits_type; |
| 513 | typedef basic_streambuf<charT, traits> streambuf_type; |
| 514 | typedef basic_ostream<charT, traits> ostream_type; |
| 515 | |
Howard Hinnant | 011138d | 2012-07-20 19:36:34 +0000 | [diff] [blame] | 516 | ostreambuf_iterator(ostream_type& s) noexcept; |
| 517 | ostreambuf_iterator(streambuf_type* s) noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 518 | ostreambuf_iterator& operator=(charT c); |
| 519 | ostreambuf_iterator& operator*(); |
| 520 | ostreambuf_iterator& operator++(); |
| 521 | ostreambuf_iterator& operator++(int); |
Howard Hinnant | 011138d | 2012-07-20 19:36:34 +0000 | [diff] [blame] | 522 | bool failed() const noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 523 | }; |
| 524 | |
Marshall Clow | 99ba002 | 2017-01-04 17:58:17 +0000 | [diff] [blame] | 525 | template <class C> constexpr auto begin(C& c) -> decltype(c.begin()); |
| 526 | template <class C> constexpr auto begin(const C& c) -> decltype(c.begin()); |
| 527 | template <class C> constexpr auto end(C& c) -> decltype(c.end()); |
| 528 | template <class C> constexpr auto end(const C& c) -> decltype(c.end()); |
| 529 | template <class T, size_t N> constexpr T* begin(T (&array)[N]); |
| 530 | template <class T, size_t N> constexpr T* end(T (&array)[N]); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 531 | |
Marshall Clow | 99ba002 | 2017-01-04 17:58:17 +0000 | [diff] [blame] | 532 | template <class C> auto constexpr cbegin(const C& c) -> decltype(std::begin(c)); // C++14 |
| 533 | template <class C> auto constexpr cend(const C& c) -> decltype(std::end(c)); // C++14 |
| 534 | template <class C> auto constexpr rbegin(C& c) -> decltype(c.rbegin()); // C++14 |
| 535 | template <class C> auto constexpr rbegin(const C& c) -> decltype(c.rbegin()); // C++14 |
| 536 | template <class C> auto constexpr rend(C& c) -> decltype(c.rend()); // C++14 |
| 537 | template <class C> constexpr auto rend(const C& c) -> decltype(c.rend()); // C++14 |
| 538 | template <class E> reverse_iterator<const E*> constexpr rbegin(initializer_list<E> il); // C++14 |
| 539 | template <class E> reverse_iterator<const E*> constexpr rend(initializer_list<E> il); // C++14 |
| 540 | template <class T, size_t N> reverse_iterator<T*> constexpr rbegin(T (&array)[N]); // C++14 |
| 541 | template <class T, size_t N> reverse_iterator<T*> constexpr rend(T (&array)[N]); // C++14 |
| 542 | template <class C> constexpr auto crbegin(const C& c) -> decltype(std::rbegin(c)); // C++14 |
| 543 | template <class C> constexpr auto crend(const C& c) -> decltype(std::rend(c)); // C++14 |
Marshall Clow | b278e9c | 2013-08-30 01:17:07 +0000 | [diff] [blame] | 544 | |
Marshall Clow | ef35727 | 2014-11-19 19:43:23 +0000 | [diff] [blame] | 545 | // 24.8, container access: |
| 546 | template <class C> constexpr auto size(const C& c) -> decltype(c.size()); // C++17 |
| 547 | template <class T, size_t N> constexpr size_t size(const T (&array)[N]) noexcept; // C++17 |
Marshall Clow | 3c5363e | 2019-02-27 02:58:56 +0000 | [diff] [blame] | 548 | |
| 549 | template <class C> constexpr auto ssize(const C& c) |
Arthur O'Dwyer | 2fc9b5d | 2021-04-17 17:03:20 -0400 | [diff] [blame] | 550 | -> common_type_t<ptrdiff_t, make_signed_t<decltype(c.size())>>; // C++20 |
Marshall Clow | 3c5363e | 2019-02-27 02:58:56 +0000 | [diff] [blame] | 551 | template <class T, ptrdiff_t> constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept; // C++20 |
| 552 | |
Marshall Clow | ef35727 | 2014-11-19 19:43:23 +0000 | [diff] [blame] | 553 | template <class C> constexpr auto empty(const C& c) -> decltype(c.empty()); // C++17 |
| 554 | template <class T, size_t N> constexpr bool empty(const T (&array)[N]) noexcept; // C++17 |
| 555 | template <class E> constexpr bool empty(initializer_list<E> il) noexcept; // C++17 |
| 556 | template <class C> constexpr auto data(C& c) -> decltype(c.data()); // C++17 |
| 557 | template <class C> constexpr auto data(const C& c) -> decltype(c.data()); // C++17 |
| 558 | template <class T, size_t N> constexpr T* data(T (&array)[N]) noexcept; // C++17 |
| 559 | template <class E> constexpr const E* data(initializer_list<E> il) noexcept; // C++17 |
| 560 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 561 | } // std |
| 562 | |
| 563 | */ |
| 564 | |
| 565 | #include <__config> |
Arthur O'Dwyer | a2f99ee | 2021-04-29 17:40:17 -0400 | [diff] [blame] | 566 | #include <__debug> |
Marshall Clow | 3dc0550 | 2014-02-27 02:11:50 +0000 | [diff] [blame] | 567 | #include <__functional_base> |
Christopher Di Bella | c7674cd | 2021-06-29 02:32:59 +0000 | [diff] [blame] | 568 | #include <__iterator/access.h> |
Christopher Di Bella | c6ead65 | 2021-05-05 07:14:08 +0000 | [diff] [blame] | 569 | #include <__iterator/advance.h> |
Louis Dionne | 7724952 | 2021-06-11 09:55:11 -0400 | [diff] [blame] | 570 | #include <__iterator/back_insert_iterator.h> |
zoecarver | 6eb71a9 | 2021-05-27 09:23:19 -0700 | [diff] [blame] | 571 | #include <__iterator/common_iterator.h> |
Louis Dionne | 463afb8 | 2021-04-22 11:05:30 -0400 | [diff] [blame] | 572 | #include <__iterator/concepts.h> |
Christopher Di Bella | c7674cd | 2021-06-29 02:32:59 +0000 | [diff] [blame] | 573 | #include <__iterator/data.h> |
zoecarver | 63f1320 | 2021-06-01 12:55:33 -0700 | [diff] [blame] | 574 | #include <__iterator/default_sentinel.h> |
Christopher Di Bella | c7674cd | 2021-06-29 02:32:59 +0000 | [diff] [blame] | 575 | #include <__iterator/distance.h> |
| 576 | #include <__iterator/empty.h> |
| 577 | #include <__iterator/erase_if_container.h> |
Louis Dionne | 7724952 | 2021-06-11 09:55:11 -0400 | [diff] [blame] | 578 | #include <__iterator/front_insert_iterator.h> |
zoecarver | 61ae1dc | 2021-04-19 14:28:27 -0400 | [diff] [blame] | 579 | #include <__iterator/incrementable_traits.h> |
Louis Dionne | 7724952 | 2021-06-11 09:55:11 -0400 | [diff] [blame] | 580 | #include <__iterator/insert_iterator.h> |
Louis Dionne | 7724952 | 2021-06-11 09:55:11 -0400 | [diff] [blame] | 581 | #include <__iterator/istreambuf_iterator.h> |
Christopher Di Bella | c7674cd | 2021-06-29 02:32:59 +0000 | [diff] [blame] | 582 | #include <__iterator/istream_iterator.h> |
| 583 | #include <__iterator/iterator.h> |
| 584 | #include <__iterator/iterator_traits.h> |
Louis Dionne | ca989a5 | 2021-04-20 14:40:43 -0400 | [diff] [blame] | 585 | #include <__iterator/iter_move.h> |
zoecarver | 31f4f5d | 2021-05-18 16:18:18 -0700 | [diff] [blame] | 586 | #include <__iterator/iter_swap.h> |
Louis Dionne | 7724952 | 2021-06-11 09:55:11 -0400 | [diff] [blame] | 587 | #include <__iterator/move_iterator.h> |
Christopher Di Bella | 9c0adab | 2021-05-08 05:02:43 +0000 | [diff] [blame] | 588 | #include <__iterator/next.h> |
Louis Dionne | 7724952 | 2021-06-11 09:55:11 -0400 | [diff] [blame] | 589 | #include <__iterator/ostreambuf_iterator.h> |
Christopher Di Bella | c7674cd | 2021-06-29 02:32:59 +0000 | [diff] [blame] | 590 | #include <__iterator/ostream_iterator.h> |
Christopher Di Bella | b8e2104 | 2021-05-16 01:39:22 +0000 | [diff] [blame] | 591 | #include <__iterator/prev.h> |
Louis Dionne | 170a03c | 2021-04-28 15:02:08 -0400 | [diff] [blame] | 592 | #include <__iterator/projected.h> |
zoecarver | 61ae1dc | 2021-04-19 14:28:27 -0400 | [diff] [blame] | 593 | #include <__iterator/readable_traits.h> |
Christopher Di Bella | c7674cd | 2021-06-29 02:32:59 +0000 | [diff] [blame] | 594 | #include <__iterator/reverse_access.h> |
Louis Dionne | 7724952 | 2021-06-11 09:55:11 -0400 | [diff] [blame] | 595 | #include <__iterator/reverse_iterator.h> |
Christopher Di Bella | c7674cd | 2021-06-29 02:32:59 +0000 | [diff] [blame] | 596 | #include <__iterator/size.h> |
Louis Dionne | 7724952 | 2021-06-11 09:55:11 -0400 | [diff] [blame] | 597 | #include <__iterator/wrap_iter.h> |
Louis Dionne | 735bc46 | 2021-04-14 13:59:03 -0400 | [diff] [blame] | 598 | #include <__memory/addressof.h> |
Arthur O'Dwyer | 1ac9f09 | 2021-01-15 12:59:56 -0500 | [diff] [blame] | 599 | #include <__memory/pointer_traits.h> |
Christopher Di Bella | 41f26e8 | 2021-06-05 02:47:47 +0000 | [diff] [blame] | 600 | #include <__utility/forward.h> |
Arthur O'Dwyer | a2f99ee | 2021-04-29 17:40:17 -0400 | [diff] [blame] | 601 | #include <compare> |
| 602 | #include <concepts> // Mandated by the Standard. |
| 603 | #include <cstddef> |
| 604 | #include <initializer_list> |
Arthur O'Dwyer | a2f99ee | 2021-04-29 17:40:17 -0400 | [diff] [blame] | 605 | #include <type_traits> |
Marshall Clow | 0a1e750 | 2018-09-12 19:41:40 +0000 | [diff] [blame] | 606 | #include <version> |
Howard Hinnant | 48fd5d5 | 2012-11-14 21:17:15 +0000 | [diff] [blame] | 607 | |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 608 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 609 | #pragma GCC system_header |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 610 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 611 | |
Louis Dionne | 2b1ceaa | 2021-04-20 12:03:32 -0400 | [diff] [blame] | 612 | #endif // _LIBCPP_ITERATOR |