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