author | Michael Krelin <hacker@klever.net> | 2014-03-05 21:13:36 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2014-03-05 21:13:36 (UTC) |
commit | 00cf4285fb0539873754f23a654b9cd13ae29af4 (patch) (unidiff) | |
tree | 67c80f2ea5c548d8ff06e9997fd00ddff1db3a50 /include/opkele | |
parent | 5b6756787fb7005b98ad43fb875fbaa0d33a5e88 (diff) | |
download | libopkele-00cf4285fb0539873754f23a654b9cd13ae29af4.zip libopkele-00cf4285fb0539873754f23a654b9cd13ae29af4.tar.gz libopkele-00cf4285fb0539873754f23a654b9cd13ae29af4.tar.bz2 |
remove post-increment implementation as it is awfully invalid
as per github issue #5
-rw-r--r-- | include/opkele/iterator.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/include/opkele/iterator.h b/include/opkele/iterator.h index 94da7e4..9e5b196 100644 --- a/include/opkele/iterator.h +++ b/include/opkele/iterator.h | |||
@@ -146,37 +146,32 @@ namespace opkele { | |||
146 | bool operator!=(const basic_filterator<IT>& x) const { | 146 | bool operator!=(const basic_filterator<IT>& x) const { |
147 | return empty!=x.empty || it!=x.it; } | 147 | return empty!=x.empty || it!=x.it; } |
148 | 148 | ||
149 | typename IT::reference operator*() const { | 149 | typename IT::reference operator*() const { |
150 | assert(!empty); | 150 | assert(!empty); |
151 | return *it; } | 151 | return *it; } |
152 | typename IT::pointer operator->() const { | 152 | typename IT::pointer operator->() const { |
153 | assert(!empty); | 153 | assert(!empty); |
154 | return it.operator->(); } | 154 | return it.operator->(); } |
155 | 155 | ||
156 | basic_filterator<IT>& operator++() { | 156 | basic_filterator<IT>& operator++() { |
157 | bool found = false; | 157 | bool found = false; |
158 | for(++it;!(it==ei || (found=is_interesting()));++it) ; | 158 | for(++it;!(it==ei || (found=is_interesting()));++it) ; |
159 | if(!found) empty=true; | 159 | if(!found) empty=true; |
160 | return *this; | 160 | return *this; |
161 | } | 161 | } |
162 | basic_filterator<IT> operator++(int) { | ||
163 | basic_filterator<IT> rv(*this); | ||
164 | ++(*this); | ||
165 | return rv; | ||
166 | } | ||
167 | 162 | ||
168 | void prepare() { | 163 | void prepare() { |
169 | bool found = false; | 164 | bool found = false; |
170 | for(;!(it==ei || (found=is_interesting()));++it) ; | 165 | for(;!(it==ei || (found=is_interesting()));++it) ; |
171 | if(!found) empty = true; | 166 | if(!found) empty = true; |
172 | } | 167 | } |
173 | virtual bool is_interesting() const = 0; | 168 | virtual bool is_interesting() const = 0; |
174 | }; | 169 | }; |
175 | 170 | ||
176 | template<typename IT,typename T=typename IT::value_type::first_type,typename TR=T&,typename TP=T*> | 171 | template<typename IT,typename T=typename IT::value_type::first_type,typename TR=T&,typename TP=T*> |
177 | class map_keys_iterator : public iterator< | 172 | class map_keys_iterator : public iterator< |
178 | typename IT::iterator_category, | 173 | typename IT::iterator_category, |
179 | T,void,TP,TR> { | 174 | T,void,TP,TR> { |
180 | public: | 175 | public: |
181 | typedef map_keys_iterator<IT,T,TR,TP> self_type; | 176 | typedef map_keys_iterator<IT,T,TR,TP> self_type; |
182 | IT it; | 177 | IT it; |