OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project 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 V8_BASE_ITERATOR_H_ | 5 #ifndef V8_BASE_ITERATOR_H_ |
6 #define V8_BASE_ITERATOR_H_ | 6 #define V8_BASE_ITERATOR_H_ |
7 | 7 |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "src/base/macros.h" | |
11 | |
12 namespace v8 { | 10 namespace v8 { |
13 namespace base { | 11 namespace base { |
14 | 12 |
15 // The intention of the base::iterator_range class is to encapsulate two | 13 // The intention of the base::iterator_range class is to encapsulate two |
16 // iterators so that the range defined by the iterators can be used like | 14 // iterators so that the range defined by the iterators can be used like |
17 // a regular STL container (actually only a subset of the full container | 15 // a regular STL container (actually only a subset of the full container |
18 // functionality is available usually). | 16 // functionality is available usually). |
19 template <typename ForwardIterator> | 17 template <typename ForwardIterator> |
20 class iterator_range { | 18 class iterator_range { |
21 public: | 19 public: |
(...skipping 25 matching lines...) Expand all Loading... |
47 | 45 |
48 private: | 46 private: |
49 const_iterator const begin_; | 47 const_iterator const begin_; |
50 const_iterator const end_; | 48 const_iterator const end_; |
51 }; | 49 }; |
52 | 50 |
53 } // namespace base | 51 } // namespace base |
54 } // namespace v8 | 52 } // namespace v8 |
55 | 53 |
56 #endif // V8_BASE_ITERATOR_H_ | 54 #endif // V8_BASE_ITERATOR_H_ |
OLD | NEW |