| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 BASE_LINKED_LIST_H_ | 5 #ifndef BASE_CONTAINERS_LINKED_LIST_H_ |
| 6 #define BASE_LINKED_LIST_H_ | 6 #define BASE_CONTAINERS_LINKED_LIST_H_ |
| 7 | 7 |
| 8 // Simple LinkedList type. (See the Q&A section to understand how this | 8 // Simple LinkedList type. (See the Q&A section to understand how this |
| 9 // differs from std::list). | 9 // differs from std::list). |
| 10 // | 10 // |
| 11 // To use, start by declaring the class which will be contained in the linked | 11 // To use, start by declaring the class which will be contained in the linked |
| 12 // list, as extending LinkNode (this gives it next/previous pointers). | 12 // list, as extending LinkNode (this gives it next/previous pointers). |
| 13 // | 13 // |
| 14 // class MyNodeType : public LinkNode<MyNodeType> { | 14 // class MyNodeType : public LinkNode<MyNodeType> { |
| 15 // ... | 15 // ... |
| 16 // }; | 16 // }; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 const LinkNode<T>* end() const { | 154 const LinkNode<T>* end() const { |
| 155 return &root_; | 155 return &root_; |
| 156 } | 156 } |
| 157 | 157 |
| 158 private: | 158 private: |
| 159 LinkNode<T> root_; | 159 LinkNode<T> root_; |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 } // namespace base | 162 } // namespace base |
| 163 | 163 |
| 164 #endif // BASE_LINKED_LIST_H_ | 164 #endif // BASE_CONTAINERS_LINKED_LIST_H_ |
| OLD | NEW |