| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
| 7 | 7 |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 Iterator operator--(int) { | 190 Iterator operator--(int) { |
| 191 Iterator original = *this; | 191 Iterator original = *this; |
| 192 --pos_; | 192 --pos_; |
| 193 return original; | 193 return original; |
| 194 } | 194 } |
| 195 bool operator==(const Iterator& o) const { | 195 bool operator==(const Iterator& o) const { |
| 196 return o.arr_ == arr_ && o.pos_ == pos_; | 196 return o.arr_ == arr_ && o.pos_ == pos_; |
| 197 } | 197 } |
| 198 bool operator!=(const Iterator& o) const { return !(*this == o); } | 198 bool operator!=(const Iterator& o) const { return !(*this == o); } |
| 199 RefType operator*() const { return arr_->at(pos_); } | 199 RefType operator*() const { return arr_->at(pos_); } |
| 200 RefType operator->() const { return operator*(); } | 200 T* operator->() const { return &arr_->at(pos_); } |
| 201 | 201 |
| 202 // The following satisfy RandomAccessIterator: | 202 // The following satisfy RandomAccessIterator: |
| 203 Iterator& operator+=(difference_type dist) { | 203 Iterator& operator+=(difference_type dist) { |
| 204 pos_ += dist; | 204 pos_ += dist; |
| 205 return *this; | 205 return *this; |
| 206 } | 206 } |
| 207 Iterator& operator-=(difference_type dist) { | 207 Iterator& operator-=(difference_type dist) { |
| 208 pos_ -= dist; | 208 pos_ -= dist; |
| 209 return *this; | 209 return *this; |
| 210 } | 210 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 for (size_t i = 0; i < input.size(); ++i) | 303 for (size_t i = 0; i < input.size(); ++i) |
| 304 result.insert(TypeConverter<E, T>::Convert(input[i])); | 304 result.insert(TypeConverter<E, T>::Convert(input[i])); |
| 305 } | 305 } |
| 306 return result; | 306 return result; |
| 307 } | 307 } |
| 308 }; | 308 }; |
| 309 | 309 |
| 310 } // namespace mojo | 310 } // namespace mojo |
| 311 | 311 |
| 312 #endif // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ | 312 #endif // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_H_ |
| OLD | NEW |