| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_STACK_CONTAINER_H_ | 5 #ifndef BASE_STACK_CONTAINER_H_ |
| 6 #define BASE_STACK_CONTAINER_H_ | 6 #define BASE_STACK_CONTAINER_H_ |
| 7 #pragma once | |
| 8 | 7 |
| 9 #include <string> | 8 #include <string> |
| 10 #include <vector> | 9 #include <vector> |
| 11 | 10 |
| 12 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 13 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 14 #include "base/memory/aligned_memory.h" | 13 #include "base/memory/aligned_memory.h" |
| 15 | 14 |
| 16 // This allocator can be used with STL containers to provide a stack buffer | 15 // This allocator can be used with STL containers to provide a stack buffer |
| 17 // from which to allocate memory and overflows onto the heap. This stack buffer | 16 // from which to allocate memory and overflows onto the heap. This stack buffer |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 242 |
| 244 // Vectors are commonly indexed, which isn't very convenient even with | 243 // Vectors are commonly indexed, which isn't very convenient even with |
| 245 // operator-> (using "->at()" does exception stuff we don't want). | 244 // operator-> (using "->at()" does exception stuff we don't want). |
| 246 T& operator[](size_t i) { return this->container().operator[](i); } | 245 T& operator[](size_t i) { return this->container().operator[](i); } |
| 247 const T& operator[](size_t i) const { | 246 const T& operator[](size_t i) const { |
| 248 return this->container().operator[](i); | 247 return this->container().operator[](i); |
| 249 } | 248 } |
| 250 }; | 249 }; |
| 251 | 250 |
| 252 #endif // BASE_STACK_CONTAINER_H_ | 251 #endif // BASE_STACK_CONTAINER_H_ |
| OLD | NEW |