PPL  1.2
iterator_to_const_inlines.hh
Go to the documentation of this file.
1 /* iterator_to_const and const_iterator_to_const class implementations:
2  inline functions.
3  Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
4  Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
5 
6 This file is part of the Parma Polyhedra Library (PPL).
7 
8 The PPL is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 The PPL is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software Foundation,
20 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
21 
22 For the most up-to-date information see the Parma Polyhedra Library
23 site: http://bugseng.com/products/ppl/ . */
24 
25 #ifndef PPL_iterator_to_const_inlines_hh
26 #define PPL_iterator_to_const_inlines_hh 1
27 
28 namespace Parma_Polyhedra_Library {
29 
30 template <typename Container>
31 inline
33  : base() {
34 }
35 
36 template <typename Container>
37 inline
39  : base(y.base) {
40 }
41 
42 template <typename Container>
43 inline
45  : base(b) {
46 }
47 
48 template <typename Container>
51  return *base;
52 }
53 
54 template <typename Container>
57  return &*base;
58 }
59 
60 template <typename Container>
63  ++base;
64  return *this;
65 }
66 
67 template <typename Container>
70  iterator_to_const tmp = *this;
71  operator++();
72  return tmp;
73 }
74 
75 template <typename Container>
78  --base;
79  return *this;
80 }
81 
82 template <typename Container>
85  iterator_to_const tmp = *this;
86  operator--();
87  return tmp;
88 }
89 
90 template <typename Container>
91 inline bool
93  return base == y.base;
94 }
95 
96 template <typename Container>
97 inline bool
99  return !operator==(y);
100 }
101 
102 template <typename Container>
103 inline
105  : base() {
106 }
107 
108 template <typename Container>
109 inline
112  : base(y.base) {
113 }
114 
115 template <typename Container>
116 inline
118  : base(b) {
119 }
120 
121 template <typename Container>
124  return *base;
125 }
126 
127 template <typename Container>
130  return &*base;
131 }
132 
133 template <typename Container>
136  ++base;
137  return *this;
138 }
139 
140 template <typename Container>
143  const_iterator_to_const tmp = *this;
144  operator++();
145  return tmp;
146 }
147 
148 template <typename Container>
151  --base;
152  return *this;
153 }
154 
155 template <typename Container>
158  const_iterator_to_const tmp = *this;
159  operator--();
160  return tmp;
161 }
162 
163 template <typename Container>
164 inline bool
167  return base == y.base;
168 }
169 
170 template <typename Container>
171 inline bool
174  return !operator==(y);
175 }
176 
177 template <typename Container>
178 inline
181  : base(y.base) {
182 }
183 
185 template <typename Container>
186 inline bool
189  return const_iterator_to_const<Container>(x).operator==(y);
190 }
191 
193 template <typename Container>
194 inline bool
197  return !(x == y);
198 }
199 
200 } // namespace Parma_Polyhedra_Library
201 
202 #endif // !defined(PPL_iterator_to_const_inlines_hh)
bool operator==(const iterator_to_const< Container > &x, const const_iterator_to_const< Container > &y)
pointer operator->() const
Indirect access operator.
reference operator*() const
Dereference operator.
pointer operator->() const
Indirect member selector.
bool operator==(const iterator_to_const &y) const
Returns true if and only if *this and y are identical.
Container::iterator Base
The type of the underlying mutable iterator.
bool operator==(const const_iterator_to_const &y) const
Returns true if and only if *this and y are identical.
iterator_to_const & operator++()
Prefix increment operator.
bool operator!=(const iterator_to_const< Container > &x, const const_iterator_to_const< Container > &y)
const_iterator_to_const & operator++()
Prefix increment operator.
Base base
A const_iterator on the sequence of elements.
Base base
A (mutable) iterator on the sequence of elements.
A const_iterator on a sequence of read-only objects.
The entire library is confined to this namespace.
Definition: version.hh:61
bool operator!=(const iterator_to_const &y) const
Returns true if and only if *this and y are different.
bool operator==(const Box< ITV > &x, const Box< ITV > &y)
An iterator on a sequence of read-only objects.
iterator_to_const & operator--()
Prefix decrement operator.
reference operator*() const
Dereference operator.
Container::const_iterator Base
The type of the underlying const_iterator.
bool operator!=(const const_iterator_to_const &y) const
Returns true if and only if *this and y are different.
const_iterator_to_const & operator--()
Prefix decrement operator.