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

Side by Side Diff: third_party/libphonenumber/cpp/src/stl_util.h

Issue 8736001: Pull the phone library directly. Delete old version. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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
OLDNEW
(Empty)
1 // Copyright (C) 2011 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #ifndef I18N_PHONENUMBERS_STL_UTIL_H_
16 #define I18N_PHONENUMBERS_STL_UTIL_H_
17
18 namespace i18n {
19 namespace phonenumbers {
20
21 // Compares the first attribute of two pairs.
22 struct OrderByFirst {
23 template <typename T>
24 bool operator()(const T& p1, const T& p2) const {
25 return p1.first < p2.first;
26 }
27 };
28
29 // Deletes the second attribute (pointer type expected) of the pairs contained
30 // in the provided range.
31 template <typename ForwardIterator>
32 void STLDeleteContainerPairSecondPointers(const ForwardIterator& begin,
33 const ForwardIterator& end) {
34 for (ForwardIterator it = begin; it != end; ++it) {
35 delete it->second;
36 }
37 }
38
39 } // namespace phonenumbers
40 } // namespace i18n
41
42 #endif // I18N_PHONENUMBERS_STL_UTIL_H_
OLDNEW
« no previous file with comments | « third_party/libphonenumber/cpp/src/run_tests.cc ('k') | third_party/libphonenumber/cpp/src/stringutil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698