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

Side by Side Diff: base/stl_util.h

Issue 10735044: Remove #pragma once. Just from base/ for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/stack_container.h ('k') | base/string16.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Derived from google3/util/gtl/stl_util.h 5 // Derived from google3/util/gtl/stl_util.h
6 6
7 #ifndef BASE_STL_UTIL_H_ 7 #ifndef BASE_STL_UTIL_H_
8 #define BASE_STL_UTIL_H_ 8 #define BASE_STL_UTIL_H_
9 #pragma once
10 9
11 #include <string> 10 #include <string>
12 #include <vector> 11 #include <vector>
13 12
14 // Clears internal memory of an STL object. 13 // Clears internal memory of an STL object.
15 // STL clear()/reserve(0) does not always free internal memory allocated 14 // STL clear()/reserve(0) does not always free internal memory allocated
16 // This function uses swap/destructor to ensure the internal memory is freed. 15 // This function uses swap/destructor to ensure the internal memory is freed.
17 template<class T> 16 template<class T>
18 void STLClearObject(T* obj) { 17 void STLClearObject(T* obj) {
19 T tmp; 18 T tmp;
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 }; 185 };
187 186
188 // Test to see if a set, map, hash_set or hash_map contains a particular key. 187 // Test to see if a set, map, hash_set or hash_map contains a particular key.
189 // Returns true if the key is in the collection. 188 // Returns true if the key is in the collection.
190 template <typename Collection, typename Key> 189 template <typename Collection, typename Key>
191 bool ContainsKey(const Collection& collection, const Key& key) { 190 bool ContainsKey(const Collection& collection, const Key& key) {
192 return collection.find(key) != collection.end(); 191 return collection.find(key) != collection.end();
193 } 192 }
194 193
195 #endif // BASE_STL_UTIL_H_ 194 #endif // BASE_STL_UTIL_H_
OLDNEW
« no previous file with comments | « base/stack_container.h ('k') | base/string16.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698