diff options
author | vmpstr <vmpstr@chromium.org> | 2016-03-09 11:38:19 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-09 19:41:09 +0000 |
commit | 3abe3303bcbb2b24d7c21228f88114337347b674 (patch) | |
tree | 8c81c0ada48e93499286fc435f8a30cd8a2ef7e7 /tools/gn | |
parent | b2bf6ebb42d71afea2b6ef3834a40724fa2fb3f6 (diff) | |
download | chromium_src-3abe3303bcbb2b24d7c21228f88114337347b674.zip chromium_src-3abe3303bcbb2b24d7c21228f88114337347b674.tar.gz chromium_src-3abe3303bcbb2b24d7c21228f88114337347b674.tar.bz2 |
Remove uses of std::unary_function and std::binary_function.
This patch removes unary and binary function, since those are deprecated
in C++11. They also only provide two typedefs, so this cleans up some
code. In rare cases where the typedefs are actually required, it's
easier to just provide the typedef directly instead of deriving from
one of these functions.
BUG=593407
Review URL: https://codereview.chromium.org/1420333006
Cr-Commit-Position: refs/heads/master@{#380179}
Diffstat (limited to 'tools/gn')
-rw-r--r-- | tools/gn/label_ptr.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/gn/label_ptr.h b/tools/gn/label_ptr.h index 4ce20a6..c0b2d63 100644 --- a/tools/gn/label_ptr.h +++ b/tools/gn/label_ptr.h @@ -56,7 +56,7 @@ typedef std::vector<LabelTargetPair> LabelTargetVector; // To do a brute-force search by label: // std::find_if(vect.begin(), vect.end(), LabelPtrLabelEquals<Config>(label)); template<typename T> -struct LabelPtrLabelEquals : public std::unary_function<Label, bool> { +struct LabelPtrLabelEquals { explicit LabelPtrLabelEquals(const Label& l) : label(l) {} bool operator()(const LabelPtrPair<T>& arg) const { @@ -69,7 +69,7 @@ struct LabelPtrLabelEquals : public std::unary_function<Label, bool> { // To do a brute-force search by object pointer: // std::find_if(vect.begin(), vect.end(), LabelPtrPtrEquals<Config>(config)); template<typename T> -struct LabelPtrPtrEquals : public std::unary_function<T, bool> { +struct LabelPtrPtrEquals { explicit LabelPtrPtrEquals(const T* p) : ptr(p) {} bool operator()(const LabelPtrPair<T>& arg) const { @@ -82,9 +82,7 @@ struct LabelPtrPtrEquals : public std::unary_function<T, bool> { // To sort by label: // std::sort(vect.begin(), vect.end(), LabelPtrLabelLess<Config>()); template<typename T> -struct LabelPtrLabelLess : public std::binary_function<LabelPtrPair<T>, - LabelPtrPair<T>, - bool> { +struct LabelPtrLabelLess { bool operator()(const LabelPtrPair<T>& a, const LabelPtrPair<T>& b) const { return a.label < b.label; } |