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

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

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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 | « cc/animation/transform_operations_unittest.cc ('k') | cc/base/contiguous_container.h » ('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 2015 The Chromium Authors. All rights reserved. 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 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 CC_BASE_CONTAINER_UTIL_H_ 5 #ifndef CC_BASE_CONTAINER_UTIL_H_
6 #define CC_BASE_CONTAINER_UTIL_H_ 6 #define CC_BASE_CONTAINER_UTIL_H_
7 7
8 #include "base/memory/scoped_ptr.h"
9 8
10 namespace cc { 9 namespace cc {
11 10
12 // Removes the front element from the container and returns it. 11 // Removes the front element from the container and returns it.
13 template <typename Container> 12 template <typename Container>
14 typename Container::value_type PopFront(Container* container) { 13 typename Container::value_type PopFront(Container* container) {
15 typename Container::value_type element = std::move(container->front()); 14 typename Container::value_type element = std::move(container->front());
16 container->pop_front(); 15 container->pop_front();
17 return element; 16 return element;
18 } 17 }
19 18
20 // Removes the back element from the container and returns it. 19 // Removes the back element from the container and returns it.
21 template <typename Container> 20 template <typename Container>
22 typename Container::value_type PopBack(Container* container) { 21 typename Container::value_type PopBack(Container* container) {
23 typename Container::value_type element = std::move(container->back()); 22 typename Container::value_type element = std::move(container->back());
24 container->pop_back(); 23 container->pop_back();
25 return element; 24 return element;
26 } 25 }
27 26
28 } // namespace cc 27 } // namespace cc
29 28
30 #endif // CC_BASE_CONTAINER_UTIL_H_ 29 #endif // CC_BASE_CONTAINER_UTIL_H_
OLDNEW
« no previous file with comments | « cc/animation/transform_operations_unittest.cc ('k') | cc/base/contiguous_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698