xref: /freebsd/contrib/llvm-project/libcxx/include/iterator (revision eea7c61590ae8968b3f1f609cf0bc8633222a94f)
1// -*- C++ -*-
2//===-------------------------- iterator ----------------------------------===//
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<input_or_output_iterator I, sentinel_for<I> S>
144  requires (!same_as<I, S> && copyable<I>)
145class common_iterator;                                     // since C++20
146
147template<class Category, class T, class Distance = ptrdiff_t,
148         class Pointer = T*, class Reference = T&>
149struct iterator                                            // deprecated in C++17
150{
151    typedef T         value_type;
152    typedef Distance  difference_type;
153    typedef Pointer   pointer;
154    typedef Reference reference;
155    typedef Category  iterator_category;
156};
157
158struct input_iterator_tag  {};
159struct output_iterator_tag {};
160struct forward_iterator_tag       : public input_iterator_tag         {};
161struct bidirectional_iterator_tag : public forward_iterator_tag       {};
162struct random_access_iterator_tag : public bidirectional_iterator_tag {};
163
164// 27.4.3, iterator operations
165template <class InputIterator, class Distance>  // constexpr in C++17
166  constexpr void advance(InputIterator& i, Distance n);
167
168template <class InputIterator>  // constexpr in C++17
169  constexpr typename iterator_traits<InputIterator>::difference_type
170    distance(InputIterator first, InputIterator last);
171
172template <class InputIterator>  // constexpr in C++17
173  constexpr InputIterator next(InputIterator x,
174typename iterator_traits<InputIterator>::difference_type n = 1);
175
176template <class BidirectionalIterator>  // constexpr in C++17
177  constexpr BidirectionalIterator prev(BidirectionalIterator x,
178    typename iterator_traits<BidirectionalIterator>::difference_type n = 1);
179
180// [range.iter.ops], range iterator operations
181namespace ranges {
182  // [range.iter.op.advance], ranges::advance
183  template<input_or_output_iterator I>
184    constexpr void advance(I& i, iter_difference_t<I> n);                          // since C++20
185  template<input_or_output_iterator I, sentinel_for<I> S>
186    constexpr void advance(I& i, S bound);                                         // since C++20
187  template<input_or_output_iterator I, sentinel_for<I> S>
188    constexpr iter_difference_t<I> advance(I& i, iter_difference_t<I> n, S bound); // since C++20
189}
190
191template <class Iterator>
192class reverse_iterator
193    : public iterator<typename iterator_traits<Iterator>::iterator_category, // until C++17
194                      typename iterator_traits<Iterator>::value_type,
195                      typename iterator_traits<Iterator>::difference_type,
196                      typename iterator_traits<Iterator>::pointer,
197                      typename iterator_traits<Iterator>::reference>
198{
199protected:
200    Iterator current;
201public:
202    typedef Iterator                                            iterator_type;
203    typedef typename iterator_traits<Iterator>::difference_type difference_type;
204    typedef typename iterator_traits<Iterator>::reference       reference;
205    typedef typename iterator_traits<Iterator>::pointer         pointer;
206
207    constexpr reverse_iterator();
208    constexpr explicit reverse_iterator(Iterator x);
209    template <class U> constexpr reverse_iterator(const reverse_iterator<U>& u);
210    template <class U> constexpr reverse_iterator& operator=(const reverse_iterator<U>& u);
211    constexpr Iterator base() const;
212    constexpr reference operator*() const;
213    constexpr pointer   operator->() const;
214    constexpr reverse_iterator& operator++();
215    constexpr reverse_iterator  operator++(int);
216    constexpr reverse_iterator& operator--();
217    constexpr reverse_iterator  operator--(int);
218    constexpr reverse_iterator  operator+ (difference_type n) const;
219    constexpr reverse_iterator& operator+=(difference_type n);
220    constexpr reverse_iterator  operator- (difference_type n) const;
221    constexpr reverse_iterator& operator-=(difference_type n);
222    constexpr reference         operator[](difference_type n) const;
223};
224
225template <class Iterator1, class Iterator2>
226constexpr bool                          // constexpr in C++17
227operator==(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
228
229template <class Iterator1, class Iterator2>
230constexpr bool                          // constexpr in C++17
231operator<(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
232
233template <class Iterator1, class Iterator2>
234constexpr bool                          // constexpr in C++17
235operator!=(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
236
237template <class Iterator1, class Iterator2>
238constexpr bool                          // constexpr in C++17
239operator>(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
240
241template <class Iterator1, class Iterator2>
242constexpr bool                          // constexpr in C++17
243operator>=(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
244
245template <class Iterator1, class Iterator2>
246constexpr bool                          // constexpr in C++17
247operator<=(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
248
249template <class Iterator1, class Iterator2>
250constexpr auto
251operator-(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y)
252-> decltype(__y.base() - __x.base());   // constexpr in C++17
253
254template <class Iterator>
255constexpr reverse_iterator<Iterator>
256operator+(typename reverse_iterator<Iterator>::difference_type n,
257          const reverse_iterator<Iterator>& x);   // constexpr in C++17
258
259template <class Iterator>
260constexpr reverse_iterator<Iterator> make_reverse_iterator(Iterator i); // C++14, constexpr in C++17
261
262template <class Container>
263class back_insert_iterator
264    : public iterator<output_iterator_tag, void, void, void, void> // until C++17
265{
266protected:
267    Container* container;
268public:
269    typedef Container                   container_type;
270    typedef void                        value_type;
271    typedef void                        difference_type; // until C++20
272    typedef ptrdiff_t                   difference_type; // since C++20
273    typedef void                        reference;
274    typedef void                        pointer;
275
276    explicit back_insert_iterator(Container& x);  // constexpr in C++20
277    back_insert_iterator& operator=(const typename Container::value_type& value);  // constexpr in C++20
278    back_insert_iterator& operator*();  // constexpr in C++20
279    back_insert_iterator& operator++();  // constexpr in C++20
280    back_insert_iterator  operator++(int);  // constexpr in C++20
281};
282
283template <class Container> back_insert_iterator<Container> back_inserter(Container& x);  // constexpr in C++20
284
285template <class Container>
286class front_insert_iterator
287    : public iterator<output_iterator_tag, void, void, void, void> // until C++17
288{
289protected:
290    Container* container;
291public:
292    typedef Container                    container_type;
293    typedef void                         value_type;
294    typedef void                         difference_type; // until C++20
295    typedef ptrdiff_t                    difference_type; // since C++20
296    typedef void                         reference;
297    typedef void                         pointer;
298
299    explicit front_insert_iterator(Container& x);  // constexpr in C++20
300    front_insert_iterator& operator=(const typename Container::value_type& value);  // constexpr in C++20
301    front_insert_iterator& operator*();  // constexpr in C++20
302    front_insert_iterator& operator++();  // constexpr in C++20
303    front_insert_iterator  operator++(int);  // constexpr in C++20
304};
305
306template <class Container> front_insert_iterator<Container> front_inserter(Container& x);  // constexpr in C++20
307
308template <class Container>
309class insert_iterator
310    : public iterator<output_iterator_tag, void, void, void, void> // until C++17
311{
312protected:
313    Container* container;
314    typename Container::iterator iter;
315public:
316    typedef Container              container_type;
317    typedef void                   value_type;
318    typedef void                   difference_type; // until C++20
319    typedef ptrdiff_t              difference_type; // since C++20
320    typedef void                   reference;
321    typedef void                   pointer;
322
323    insert_iterator(Container& x, typename Container::iterator i);  // constexpr in C++20
324    insert_iterator& operator=(const typename Container::value_type& value);  // constexpr in C++20
325    insert_iterator& operator*();  // constexpr in C++20
326    insert_iterator& operator++();  // constexpr in C++20
327    insert_iterator& operator++(int);  // constexpr in C++20
328};
329
330template <class Container, class Iterator>
331insert_iterator<Container> inserter(Container& x, Iterator i);  // constexpr in C++20
332
333template <class Iterator>
334class move_iterator {
335public:
336    typedef Iterator                                              iterator_type;
337    typedef typename iterator_traits<Iterator>::difference_type   difference_type;
338    typedef Iterator                                              pointer;
339    typedef typename iterator_traits<Iterator>::value_type        value_type;
340    typedef typename iterator_traits<Iterator>::iterator_category iterator_category;
341    typedef value_type&&                                          reference;
342
343    constexpr move_iterator();  // all the constexprs are in C++17
344    constexpr explicit move_iterator(Iterator i);
345    template <class U>
346      constexpr move_iterator(const move_iterator<U>& u);
347    template <class U>
348      constexpr move_iterator& operator=(const move_iterator<U>& u);
349    constexpr iterator_type base() const;
350    constexpr reference operator*() const;
351    constexpr pointer operator->() const;
352    constexpr move_iterator& operator++();
353    constexpr move_iterator operator++(int);
354    constexpr move_iterator& operator--();
355    constexpr move_iterator operator--(int);
356    constexpr move_iterator operator+(difference_type n) const;
357    constexpr move_iterator& operator+=(difference_type n);
358    constexpr move_iterator operator-(difference_type n) const;
359    constexpr move_iterator& operator-=(difference_type n);
360    constexpr unspecified operator[](difference_type n) const;
361private:
362    Iterator current; // exposition only
363};
364
365template <class Iterator1, class Iterator2>
366constexpr bool   // constexpr in C++17
367operator==(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
368
369template <class Iterator1, class Iterator2>
370constexpr bool   // constexpr in C++17
371operator!=(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
372
373template <class Iterator1, class Iterator2>
374constexpr bool   // constexpr in C++17
375operator<(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
376
377template <class Iterator1, class Iterator2>
378constexpr bool   // constexpr in C++17
379operator<=(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
380
381template <class Iterator1, class Iterator2>
382constexpr bool   // constexpr in C++17
383operator>(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
384
385template <class Iterator1, class Iterator2>
386constexpr bool   // constexpr in C++17
387operator>=(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
388
389template <class Iterator1, class Iterator2>
390constexpr auto   // constexpr in C++17
391operator-(const move_iterator<Iterator1>& x,
392          const move_iterator<Iterator2>& y) -> decltype(x.base() - y.base());
393
394template <class Iterator>
395constexpr move_iterator<Iterator> operator+(   // constexpr in C++17
396            typename move_iterator<Iterator>::difference_type n,
397            const move_iterator<Iterator>& x);
398
399template <class Iterator>   // constexpr in C++17
400constexpr  move_iterator<Iterator> make_move_iterator(const Iterator& i);
401
402// [default.sentinel], default sentinel
403struct default_sentinel_t;
404inline constexpr default_sentinel_t default_sentinel{};
405
406// [iterators.counted], counted iterators
407template<input_or_output_iterator I> class counted_iterator;
408
409template<input_iterator I>
410  requires see below
411  struct iterator_traits<counted_iterator<I>>;
412
413template <class T, class charT = char, class traits = char_traits<charT>, class Distance = ptrdiff_t>
414class istream_iterator
415    : public iterator<input_iterator_tag, T, Distance, const T*, const T&> // until C++17
416{
417public:
418    typedef input_iterator_tag           iterator_category;
419    typedef T                            value_type;
420    typedef Distance                     difference_type;
421    typedef const T*                     pointer;
422    typedef const T&                     reference;
423
424    typedef charT                        char_type;
425    typedef traits                       traits_type;
426    typedef basic_istream<charT, traits> istream_type;
427
428    constexpr istream_iterator();
429    istream_iterator(istream_type& s);
430    istream_iterator(const istream_iterator& x);
431    ~istream_iterator();
432
433    const T& operator*() const;
434    const T* operator->() const;
435    istream_iterator& operator++();
436    istream_iterator  operator++(int);
437};
438
439template <class T, class charT, class traits, class Distance>
440bool operator==(const istream_iterator<T,charT,traits,Distance>& x,
441                const istream_iterator<T,charT,traits,Distance>& y);
442template <class T, class charT, class traits, class Distance>
443bool operator!=(const istream_iterator<T,charT,traits,Distance>& x,
444                const istream_iterator<T,charT,traits,Distance>& y);
445
446template <class T, class charT = char, class traits = char_traits<charT> >
447class ostream_iterator
448    : public iterator<output_iterator_tag, void, void, void, void> // until C++17
449{
450public:
451    typedef output_iterator_tag         iterator_category;
452    typedef void                        value_type;
453    typedef void                        difference_type; // until C++20
454    typedef ptrdiff_t                   difference_type; // since C++20
455    typedef void                        pointer;
456    typedef void                        reference;
457
458    typedef charT char_type;
459    typedef traits traits_type;
460    typedef basic_ostream<charT,traits> ostream_type;
461
462    ostream_iterator(ostream_type& s);
463    ostream_iterator(ostream_type& s, const charT* delimiter);
464    ostream_iterator(const ostream_iterator& x);
465    ~ostream_iterator();
466    ostream_iterator& operator=(const T& value);
467
468    ostream_iterator& operator*();
469    ostream_iterator& operator++();
470    ostream_iterator& operator++(int);
471};
472
473template<class charT, class traits = char_traits<charT> >
474class istreambuf_iterator
475    : public iterator<input_iterator_tag, charT, traits::off_type, unspecified, charT> // until C++17
476{
477public:
478    typedef input_iterator_tag              iterator_category;
479    typedef charT                           value_type;
480    typedef traits::off_type                difference_type;
481    typedef unspecified                     pointer;
482    typedef charT                           reference;
483
484    typedef charT                           char_type;
485    typedef traits                          traits_type;
486    typedef traits::int_type                int_type;
487    typedef basic_streambuf<charT, traits>  streambuf_type;
488    typedef basic_istream<charT, traits>    istream_type;
489
490    istreambuf_iterator() noexcept;
491    istreambuf_iterator(istream_type& s) noexcept;
492    istreambuf_iterator(streambuf_type* s) noexcept;
493    istreambuf_iterator(a-private-type) noexcept;
494
495    charT                operator*() const;
496    pointer operator->() const;
497    istreambuf_iterator& operator++();
498    a-private-type       operator++(int);
499
500    bool equal(const istreambuf_iterator& b) const;
501};
502
503template <class charT, class traits>
504bool operator==(const istreambuf_iterator<charT,traits>& a,
505                const istreambuf_iterator<charT,traits>& b);
506template <class charT, class traits>
507bool operator!=(const istreambuf_iterator<charT,traits>& a,
508                const istreambuf_iterator<charT,traits>& b);
509
510template <class charT, class traits = char_traits<charT> >
511class ostreambuf_iterator
512    : public iterator<output_iterator_tag, void, void, void, void> // until C++17
513{
514public:
515    typedef output_iterator_tag            iterator_category;
516    typedef void                           value_type;
517    typedef void                           difference_type; // until C++20
518    typedef ptrdiff_t                      difference_type; // since C++20
519    typedef void                           pointer;
520    typedef void                           reference;
521
522    typedef charT                          char_type;
523    typedef traits                         traits_type;
524    typedef basic_streambuf<charT, traits> streambuf_type;
525    typedef basic_ostream<charT, traits>   ostream_type;
526
527    ostreambuf_iterator(ostream_type& s) noexcept;
528    ostreambuf_iterator(streambuf_type* s) noexcept;
529    ostreambuf_iterator& operator=(charT c);
530    ostreambuf_iterator& operator*();
531    ostreambuf_iterator& operator++();
532    ostreambuf_iterator& operator++(int);
533    bool failed() const noexcept;
534};
535
536template <class C> constexpr auto begin(C& c) -> decltype(c.begin());
537template <class C> constexpr auto begin(const C& c) -> decltype(c.begin());
538template <class C> constexpr auto end(C& c) -> decltype(c.end());
539template <class C> constexpr auto end(const C& c) -> decltype(c.end());
540template <class T, size_t N> constexpr T* begin(T (&array)[N]);
541template <class T, size_t N> constexpr T* end(T (&array)[N]);
542
543template <class C> auto constexpr cbegin(const C& c) -> decltype(std::begin(c));        // C++14
544template <class C> auto constexpr cend(const C& c) -> decltype(std::end(c));            // C++14
545template <class C> auto constexpr rbegin(C& c) -> decltype(c.rbegin());                 // C++14
546template <class C> auto constexpr rbegin(const C& c) -> decltype(c.rbegin());           // C++14
547template <class C> auto constexpr rend(C& c) -> decltype(c.rend());                     // C++14
548template <class C> constexpr auto rend(const C& c) -> decltype(c.rend());               // C++14
549template <class E> reverse_iterator<const E*> constexpr rbegin(initializer_list<E> il); // C++14
550template <class E> reverse_iterator<const E*> constexpr rend(initializer_list<E> il);   // C++14
551template <class T, size_t N> reverse_iterator<T*> constexpr rbegin(T (&array)[N]);      // C++14
552template <class T, size_t N> reverse_iterator<T*> constexpr rend(T (&array)[N]);        // C++14
553template <class C> constexpr auto crbegin(const C& c) -> decltype(std::rbegin(c));      // C++14
554template <class C> constexpr auto crend(const C& c) -> decltype(std::rend(c));          // C++14
555
556// 24.8, container access:
557template <class C> constexpr auto size(const C& c) -> decltype(c.size());         // C++17
558template <class T, size_t N> constexpr size_t size(const T (&array)[N]) noexcept; // C++17
559
560template <class C> constexpr auto ssize(const C& c)
561    -> common_type_t<ptrdiff_t, make_signed_t<decltype(c.size())>>;                    // C++20
562template <class T, ptrdiff_t> constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept; // C++20
563
564template <class C> constexpr auto empty(const C& c) -> decltype(c.empty());       // C++17
565template <class T, size_t N> constexpr bool empty(const T (&array)[N]) noexcept;  // C++17
566template <class E> constexpr bool empty(initializer_list<E> il) noexcept;         // C++17
567template <class C> constexpr auto data(C& c) -> decltype(c.data());               // C++17
568template <class C> constexpr auto data(const C& c) -> decltype(c.data());         // C++17
569template <class T, size_t N> constexpr T* data(T (&array)[N]) noexcept;           // C++17
570template <class E> constexpr const E* data(initializer_list<E> il) noexcept;      // C++17
571
572}  // std
573
574*/
575
576#include <__config>
577#include <__debug>
578#include <__functional_base>
579#include <__iterator/access.h>
580#include <__iterator/advance.h>
581#include <__iterator/back_insert_iterator.h>
582#include <__iterator/common_iterator.h>
583#include <__iterator/concepts.h>
584#include <__iterator/counted_iterator.h>
585#include <__iterator/data.h>
586#include <__iterator/default_sentinel.h>
587#include <__iterator/distance.h>
588#include <__iterator/empty.h>
589#include <__iterator/erase_if_container.h>
590#include <__iterator/front_insert_iterator.h>
591#include <__iterator/incrementable_traits.h>
592#include <__iterator/insert_iterator.h>
593#include <__iterator/istreambuf_iterator.h>
594#include <__iterator/istream_iterator.h>
595#include <__iterator/iterator.h>
596#include <__iterator/iterator_traits.h>
597#include <__iterator/iter_move.h>
598#include <__iterator/iter_swap.h>
599#include <__iterator/move_iterator.h>
600#include <__iterator/next.h>
601#include <__iterator/ostreambuf_iterator.h>
602#include <__iterator/ostream_iterator.h>
603#include <__iterator/prev.h>
604#include <__iterator/projected.h>
605#include <__iterator/readable_traits.h>
606#include <__iterator/reverse_access.h>
607#include <__iterator/reverse_iterator.h>
608#include <__iterator/size.h>
609#include <__iterator/wrap_iter.h>
610#include <__memory/addressof.h>
611#include <__memory/pointer_traits.h>
612#include <__utility/forward.h>
613#include <compare>
614#include <concepts> // Mandated by the Standard.
615#include <cstddef>
616#include <initializer_list>
617#include <type_traits>
618#include <version>
619
620#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
621#pragma GCC system_header
622#endif
623
624#endif // _LIBCPP_ITERATOR
625