diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-02-25 17:32:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-25 17:32:02 +0100 |
commit | 9f8fb146e752db42a84e8faebed51711c43b69e6 (patch) | |
tree | 58f9574612d366fdca57da53916611063d5c6eb2 /vespalib | |
parent | b10a166fe31795debf64644508a84e0c4be45c18 (diff) | |
parent | 80d85ead3add9e63a6654d78b3ed6eb056b961a6 (diff) |
Merge pull request #21404 from vespa-engine/toregge/stop-using-std-unary-function-and-std-binary-function
Stop using std::unary_function and std::binary_function.
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/tests/stllike/hashtable_test.cpp | 4 | ||||
-rw-r--r-- | vespalib/src/tests/stllike/uniq_by_sort_map_hash.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/vespalib/src/tests/stllike/hashtable_test.cpp b/vespalib/src/tests/stllike/hashtable_test.cpp index 74490e413d1..ccb1136729e 100644 --- a/vespalib/src/tests/stllike/hashtable_test.cpp +++ b/vespalib/src/tests/stllike/hashtable_test.cpp @@ -17,7 +17,7 @@ using namespace vespalib; namespace { template<typename T> -struct Dereference : std::unary_function<T, std::unique_ptr<T>> { +struct Dereference { T &operator()(std::unique_ptr<T>& p) const { return *p; } const T& operator()(const std::unique_ptr<T>& p) const { return *p; } }; @@ -119,7 +119,7 @@ TEST("require that you can insert duplicates") { } template<typename To, typename Vector> -struct FirstInVector : std::unary_function<To, Vector> { +struct FirstInVector { To &operator()(Vector& v) const { return v[0]; } const To& operator()(const Vector& v) const { return v[0]; } }; diff --git a/vespalib/src/tests/stllike/uniq_by_sort_map_hash.cpp b/vespalib/src/tests/stllike/uniq_by_sort_map_hash.cpp index 86c3dc1411c..7b9dfc98fa5 100644 --- a/vespalib/src/tests/stllike/uniq_by_sort_map_hash.cpp +++ b/vespalib/src/tests/stllike/uniq_by_sort_map_hash.cpp @@ -92,7 +92,7 @@ private: Gid _gid; }; -struct IndirectCmp : public std::binary_function<Slot*, Slot*, bool> { +struct IndirectCmp { bool operator() (const Slot* s1, const Slot* s2) noexcept { return s1->cmp(*s2) < 0; } |