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

Side by Side Diff: chrome/common/stl_util-inl.h

Issue 2929: Some initial work on compiling chrome/common/ on Linux.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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 | « chrome/common/slide_animation.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // 1 //
2 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 2 // 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 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 // 5 //
6 // STL utility functions. Usually, these replace built-in, but slow(!), 6 // STL utility functions. Usually, these replace built-in, but slow(!),
7 // STL functions with more efficient versions. 7 // STL functions with more efficient versions.
8 // 8 //
9 9
10 #ifndef CHROME_COMMON_STL_UTIL_INL_H__ 10 #ifndef CHROME_COMMON_STL_UTIL_INL_H__
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 template<typename Pair, typename BinaryOp> 434 template<typename Pair, typename BinaryOp>
435 BinaryOperateOnSecond<Pair, BinaryOp> BinaryOperate2nd(const BinaryOp& f) { 435 BinaryOperateOnSecond<Pair, BinaryOp> BinaryOperate2nd(const BinaryOp& f) {
436 return BinaryOperateOnSecond<Pair, BinaryOp>(f); 436 return BinaryOperateOnSecond<Pair, BinaryOp>(f);
437 } 437 }
438 438
439 // Translates a set into a vector. 439 // Translates a set into a vector.
440 template<typename T> 440 template<typename T>
441 std::vector<T> SetToVector(const std::set<T>& values) { 441 std::vector<T> SetToVector(const std::set<T>& values) {
442 std::vector<T> result; 442 std::vector<T> result;
443 result.reserve(values.size()); 443 result.reserve(values.size());
444 std::set<T>::const_iterator end = values.end(); 444 result.insert(0, values.begin(), value.end());
445 for (std::set<T>::const_iterator itr = values.begin(); itr != end; ++itr) {
446 result.push_back(*itr);
447 }
448 return result; 445 return result;
449 } 446 }
450 447
451 #endif // CHROME_COMMON_STL_UTIL_INL_H__ 448 #endif // CHROME_COMMON_STL_UTIL_INL_H__
452
OLDNEW
« no previous file with comments | « chrome/common/slide_animation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698