Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Side by Side Diff: base/containers/stack_container.h

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/containers/mru_cache.h ('k') | base/debug/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_CONTAINERS_STACK_CONTAINER_H_ 5 #ifndef BASE_CONTAINERS_STACK_CONTAINER_H_
6 #define BASE_CONTAINERS_STACK_CONTAINER_H_ 6 #define BASE_CONTAINERS_STACK_CONTAINER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 const typename Allocator::Source& stack_data() const { 169 const typename Allocator::Source& stack_data() const {
170 return stack_data_; 170 return stack_data_;
171 } 171 }
172 #endif 172 #endif
173 173
174 protected: 174 protected:
175 typename Allocator::Source stack_data_; 175 typename Allocator::Source stack_data_;
176 Allocator allocator_; 176 Allocator allocator_;
177 ContainerType container_; 177 ContainerType container_;
178 178
179 private:
179 DISALLOW_COPY_AND_ASSIGN(StackContainer); 180 DISALLOW_COPY_AND_ASSIGN(StackContainer);
180 }; 181 };
181 182
182 // StackString ----------------------------------------------------------------- 183 // StackString -----------------------------------------------------------------
183 184
184 template<size_t stack_capacity> 185 template<size_t stack_capacity>
185 class StackString : public StackContainer< 186 class StackString : public StackContainer<
186 std::basic_string<char, 187 std::basic_string<char,
187 std::char_traits<char>, 188 std::char_traits<char>,
188 StackAllocator<char, stack_capacity> >, 189 StackAllocator<char, stack_capacity> >,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 // operator-> (using "->at()" does exception stuff we don't want). 257 // operator-> (using "->at()" does exception stuff we don't want).
257 T& operator[](size_t i) { return this->container().operator[](i); } 258 T& operator[](size_t i) { return this->container().operator[](i); }
258 const T& operator[](size_t i) const { 259 const T& operator[](size_t i) const {
259 return this->container().operator[](i); 260 return this->container().operator[](i);
260 } 261 }
261 }; 262 };
262 263
263 } // namespace base 264 } // namespace base
264 265
265 #endif // BASE_CONTAINERS_STACK_CONTAINER_H_ 266 #endif // BASE_CONTAINERS_STACK_CONTAINER_H_
OLDNEW
« no previous file with comments | « base/containers/mru_cache.h ('k') | base/debug/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698