]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 24_iterators / headers / iterator / synopsis.cc
1 // { dg-options "-std=gnu++98" }
2 // { dg-do compile }
3
4 // Copyright (C) 2007-2017 Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
11
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
20
21 #include <iterator>
22
23 namespace std {
24
25 // 24.3, primitives:
26 template<class Iterator> struct iterator_traits;
27 template<class T> struct iterator_traits<T*>;
28
29 template<class Category, class T, class Distance,
30 class Pointer, class Reference> struct iterator;
31
32 struct input_iterator_tag;
33 struct output_iterator_tag;
34 struct forward_iterator_tag;
35 struct bidirectional_iterator_tag;
36 struct random_access_iterator_tag;
37
38 // 24.3.4, iterator operations:
39 template <class InputIterator, class Distance>
40 void
41 advance(InputIterator& i, Distance n);
42
43 template <class InputIterator>
44 typename iterator_traits<InputIterator>::difference_type
45 distance(InputIterator first, InputIterator last);
46
47 // 24.4, predefined iterators:
48 template <class Iterator> class reverse_iterator;
49
50 template <class Iterator>
51 bool operator==(const reverse_iterator<Iterator>& x,
52 const reverse_iterator<Iterator>& y);
53
54 template <class Iterator>
55 bool operator<(const reverse_iterator<Iterator>& x,
56 const reverse_iterator<Iterator>& y);
57
58 template <class Iterator>
59 bool operator!=(const reverse_iterator<Iterator>& x,
60 const reverse_iterator<Iterator>& y);
61
62 template <class Iterator>
63 bool operator>(const reverse_iterator<Iterator>& x,
64 const reverse_iterator<Iterator>& y);
65
66 template <class Iterator>
67 bool operator>=(const reverse_iterator<Iterator>& x,
68 const reverse_iterator<Iterator>& y);
69
70 template <class Iterator>
71 bool operator<=(const reverse_iterator<Iterator>& x,
72 const reverse_iterator<Iterator>& y);
73
74 template <class Iterator>
75 typename reverse_iterator<Iterator>::difference_type
76 operator-(const reverse_iterator<Iterator>& x,
77 const reverse_iterator<Iterator>& y);
78
79 template <class Iterator>
80 reverse_iterator<Iterator>
81 operator+(typename reverse_iterator<Iterator>::difference_type n,
82 const reverse_iterator<Iterator>& x);
83
84 template <class Container> class back_insert_iterator;
85
86 template <class Container>
87 back_insert_iterator<Container> back_inserter(Container& x);
88
89 template <class Container> class front_insert_iterator;
90
91 template <class Container>
92 front_insert_iterator<Container> front_inserter(Container& x);
93
94 template <class Container> class insert_iterator;
95
96 template <class Container, class Iterator>
97 insert_iterator<Container> inserter(Container& x, Iterator i);
98
99 // 24.5, stream iterators:
100 template <class T, class charT, class traits, class Distance>
101 class istream_iterator;
102
103 template <class T, class charT, class traits, class Distance>
104 bool operator==(const istream_iterator<T,charT,traits,Distance>& x,
105 const istream_iterator<T,charT,traits,Distance>& y);
106
107 template <class T, class charT, class traits, class Distance>
108 bool operator!=(const istream_iterator<T,charT,traits,Distance>& x,
109 const istream_iterator<T,charT,traits,Distance>& y);
110
111 template <class T, class charT, class traits>
112 class ostream_iterator;
113
114 template<class charT, class traits>
115 class istreambuf_iterator;
116
117 template <class charT, class traits>
118 bool
119 operator==(const istreambuf_iterator<charT,traits>&,
120 const istreambuf_iterator<charT,traits>&);
121
122 template <class charT, class traits>
123 bool operator!=(const istreambuf_iterator<charT,traits>&,
124 const istreambuf_iterator<charT,traits>&);
125
126 template <class charT, class traits>
127 class ostreambuf_iterator;
128 }