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

Side by Side Diff: cc/base/container_util.h

Issue 1441613002: cc: Remove ScopedPtrDeque. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « cc/base/BUILD.gn ('k') | cc/base/scoped_ptr_deque.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_BASE_CONTAINER_UTIL_H_
6 #define CC_BASE_CONTAINER_UTIL_H_
7
8 #include "base/memory/scoped_ptr.h"
9
10 namespace cc {
11
12 // Removes the front element from the container and returns it. Note that this
13 // currently only works with types that implement Pass().
14 // TODO(vmpstr): Use std::move instead of Pass when allowed.
15 template <typename Container>
16 typename Container::value_type PopFront(Container* container) {
17 typename Container::value_type element = container->front().Pass();
18 container->pop_front();
19 return element;
20 }
21
22 // Removes the back element from the container and returns it. Note that this
23 // currently only works with types that implement Pass().
24 // TODO(vmpstr): Use std::move instead of Pass when allowed.
25 template <typename Container>
26 typename Container::value_type PopBack(Container* container) {
27 typename Container::value_type element = container->back().Pass();
28 container->pop_back();
29 return element;
30 }
31
32 } // namespace cc
33
34 #endif // CC_BASE_CONTAINER_UTIL_H_
OLDNEW
« no previous file with comments | « cc/base/BUILD.gn ('k') | cc/base/scoped_ptr_deque.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698