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

Side by Side Diff: base/stl_util-inl.h

Issue 107001: Move scoped_vector.h and stl_util-inl.h to base/ (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « base/scoped_vector.h ('k') | chrome/browser/bookmarks/bookmark_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //
2 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
3 // 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
4 // found in the LICENSE file. 3 // found in the LICENSE file.
5 // 4
6 // STL utility functions. Usually, these replace built-in, but slow(!), 5 // STL utility functions. Usually, these replace built-in, but slow(!),
7 // STL functions with more efficient versions. 6 // STL functions with more efficient versions.
8 //
9 7
10 #ifndef CHROME_COMMON_STL_UTIL_INL_H__ 8 #ifndef BASE_STL_UTIL_INL_H_
11 #define CHROME_COMMON_STL_UTIL_INL_H__ 9 #define BASE_STL_UTIL_INL_H_
12 10
13 #include <string.h> // for memcpy 11 #include <string.h> // for memcpy
14 #include <functional> 12 #include <functional>
15 #include <set> 13 #include <set>
16 #include <string> 14 #include <string>
17 #include <vector> 15 #include <vector>
18 #include <cassert> 16 #include <cassert>
19 17
20 // Clear internal memory of an STL object. 18 // Clear internal memory of an STL object.
21 // STL clear()/reserve(0) does not always free internal memory allocated 19 // STL clear()/reserve(0) does not always free internal memory allocated
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 440
443 // Translates a set into a vector. 441 // Translates a set into a vector.
444 template<typename T> 442 template<typename T>
445 std::vector<T> SetToVector(const std::set<T>& values) { 443 std::vector<T> SetToVector(const std::set<T>& values) {
446 std::vector<T> result; 444 std::vector<T> result;
447 result.reserve(values.size()); 445 result.reserve(values.size());
448 result.insert(result.begin(), values.begin(), values.end()); 446 result.insert(result.begin(), values.begin(), values.end());
449 return result; 447 return result;
450 } 448 }
451 449
452 #endif // CHROME_COMMON_STL_UTIL_INL_H__ 450 #endif // BASE_STL_UTIL_INL_H_
OLDNEW
« no previous file with comments | « base/scoped_vector.h ('k') | chrome/browser/bookmarks/bookmark_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698