| 1 |
// { dg-options "-std=gnu++11" } |
| 2 |
// { dg-do compile { target c++11_only } } |
| 3 |
// { dg-require-normal-namespace "" } |
| 4 |
|
| 5 |
// Copyright (C) 2016-2025 Free Software Foundation, Inc. |
| 6 |
// |
| 7 |
// This file is part of the GNU ISO C++ Library. This library is free |
| 8 |
// software; you can redistribute it and/or modify it under the |
| 9 |
// terms of the GNU General Public License as published by the |
| 10 |
// Free Software Foundation; either version 3, or (at your option) |
| 11 |
// any later version. |
| 12 |
|
| 13 |
// This library is distributed in the hope that it will be useful, |
| 14 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
// GNU General Public License for more details. |
| 17 |
|
| 18 |
// You should have received a copy of the GNU General Public License along |
| 19 |
// with this library; see the file COPYING3. If not see |
| 20 |
// <http://www.gnu.org/licenses/>. |
| 21 |
|
| 22 |
#include <iterator> |
| 23 |
|
| 24 |
namespace std { |
| 25 |
|
| 26 |
// C++11 24.4.4, iterator operations: |
| 27 |
template <class InputIterator, class Distance> |
| 28 |
void |
| 29 |
advance(InputIterator& i, Distance n); |
| 30 |
|
| 31 |
template <class InputIterator> |
| 32 |
typename iterator_traits<InputIterator>::difference_type |
| 33 |
distance(InputIterator first, InputIterator last); |
| 34 |
|
| 35 |
template<class ForwardIterator> |
| 36 |
ForwardIterator |
| 37 |
next(ForwardIterator x, |
| 38 |
typename iterator_traits<ForwardIterator>::difference_type); |
| 39 |
|
| 40 |
template<class BidirectionalIterator> |
| 41 |
BidirectionalIterator |
| 42 |
prev(BidirectionalIterator x, |
| 43 |
typename iterator_traits<BidirectionalIterator>::difference_type); |
| 44 |
|
| 45 |
// C++11 24.5, Iterator adaptors: |
| 46 |
template <class Iterator> class reverse_iterator; |
| 47 |
|
| 48 |
template <class Iterator1, class Iterator2> |
| 49 |
bool operator==(const reverse_iterator<Iterator1>& x, |
| 50 |
const reverse_iterator<Iterator2>& y); |
| 51 |
|
| 52 |
template <class Iterator1, class Iterator2> |
| 53 |
bool operator<(const reverse_iterator<Iterator1>& x, |
| 54 |
const reverse_iterator<Iterator2>& y); |
| 55 |
|
| 56 |
template <class Iterator1, class Iterator2> |
| 57 |
bool operator!=(const reverse_iterator<Iterator1>& x, |
| 58 |
const reverse_iterator<Iterator2>& y); |
| 59 |
|
| 60 |
template <class Iterator1, class Iterator2> |
| 61 |
bool operator>(const reverse_iterator<Iterator1>& x, |
| 62 |
const reverse_iterator<Iterator2>& y); |
| 63 |
|
| 64 |
template <class Iterator1, class Iterator2> |
| 65 |
bool operator>=(const reverse_iterator<Iterator1>& x, |
| 66 |
const reverse_iterator<Iterator2>& y); |
| 67 |
|
| 68 |
template <class Iterator1, class Iterator2> |
| 69 |
bool operator<=(const reverse_iterator<Iterator1>& x, |
| 70 |
const reverse_iterator<Iterator2>& y); |
| 71 |
|
| 72 |
template <class Iterator1, class Iterator2> |
| 73 |
auto |
| 74 |
operator-(const reverse_iterator<Iterator1>& x, |
| 75 |
const reverse_iterator<Iterator2>& y) |
| 76 |
-> decltype(x.base() - y.base()); |
| 77 |
|
| 78 |
template <class Iterator> |
| 79 |
reverse_iterator<Iterator> |
| 80 |
operator+(typename reverse_iterator<Iterator>::difference_type n, |
| 81 |
const reverse_iterator<Iterator>& x); |
| 82 |
|
| 83 |
template <class Container> class back_insert_iterator; |
| 84 |
|
| 85 |
template <class Container> |
| 86 |
back_insert_iterator<Container> back_inserter(Container& x); |
| 87 |
|
| 88 |
template <class Container> class front_insert_iterator; |
| 89 |
|
| 90 |
template <class Container> |
| 91 |
front_insert_iterator<Container> front_inserter(Container& x); |
| 92 |
|
| 93 |
template <class Container> class insert_iterator; |
| 94 |
|
| 95 |
template <class Container, class Iterator> |
| 96 |
insert_iterator<Container> inserter(Container& x, Iterator i); |
| 97 |
|
| 98 |
template <class Iterator> class move_iterator; |
| 99 |
|
| 100 |
template <class Iterator1, class Iterator2> |
| 101 |
bool operator==(const move_iterator<Iterator1>& x, |
| 102 |
const move_iterator<Iterator2>& y); |
| 103 |
|
| 104 |
template <class Iterator1, class Iterator2> |
| 105 |
bool operator!=(const move_iterator<Iterator1>& x, |
| 106 |
const move_iterator<Iterator2>& y); |
| 107 |
|
| 108 |
template <class Iterator1, class Iterator2> |
| 109 |
bool operator<(const move_iterator<Iterator1>& x, |
| 110 |
const move_iterator<Iterator2>& y); |
| 111 |
|
| 112 |
template <class Iterator1, class Iterator2> |
| 113 |
bool operator<=(const move_iterator<Iterator1>& x, |
| 114 |
const move_iterator<Iterator2>& y); |
| 115 |
|
| 116 |
template <class Iterator1, class Iterator2> |
| 117 |
bool operator>(const move_iterator<Iterator1>& x, |
| 118 |
const move_iterator<Iterator2>& y); |
| 119 |
|
| 120 |
template <class Iterator1, class Iterator2> |
| 121 |
bool operator>=(const move_iterator<Iterator1>& x, |
| 122 |
const move_iterator<Iterator2>& y); |
| 123 |
|
| 124 |
template <class Iterator1, class Iterator2> |
| 125 |
auto operator-(const move_iterator<Iterator1>& x, |
| 126 |
const move_iterator<Iterator2>& y) |
| 127 |
-> decltype(x.base() - y.base()); |
| 128 |
|
| 129 |
template <class Iterator> |
| 130 |
move_iterator<Iterator> |
| 131 |
operator+(typename move_iterator<Iterator>::difference_type, |
| 132 |
const move_iterator<Iterator>&); |
| 133 |
|
| 134 |
template <class Iterator> |
| 135 |
move_iterator<Iterator> make_move_iterator(const Iterator&); |
| 136 |
|
| 137 |
// 24.6, stream iterators: |
| 138 |
template <class T, class charT, class traits, class Distance> |
| 139 |
class istream_iterator; |
| 140 |
|
| 141 |
template <class T, class charT, class traits, class Distance> |
| 142 |
bool operator==(const istream_iterator<T,charT,traits,Distance>& x, |
| 143 |
const istream_iterator<T,charT,traits,Distance>& y); |
| 144 |
|
| 145 |
template <class T, class charT, class traits, class Distance> |
| 146 |
bool operator!=(const istream_iterator<T,charT,traits,Distance>& x, |
| 147 |
const istream_iterator<T,charT,traits,Distance>& y); |
| 148 |
|
| 149 |
template <class T, class charT, class traits> |
| 150 |
class ostream_iterator; |
| 151 |
|
| 152 |
template<class charT, class traits> |
| 153 |
class istreambuf_iterator; |
| 154 |
|
| 155 |
template <class charT, class traits> |
| 156 |
bool |
| 157 |
operator==(const istreambuf_iterator<charT,traits>&, |
| 158 |
const istreambuf_iterator<charT,traits>&); |
| 159 |
|
| 160 |
template <class charT, class traits> |
| 161 |
bool operator!=(const istreambuf_iterator<charT,traits>&, |
| 162 |
const istreambuf_iterator<charT,traits>&); |
| 163 |
|
| 164 |
template <class charT, class traits> |
| 165 |
class ostreambuf_iterator; |
| 166 |
} |