diff options
Diffstat (limited to 'vespalib/src/tests/stllike')
-rw-r--r-- | vespalib/src/tests/stllike/hash_test.cpp | 4 | ||||
-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 |
3 files changed, 5 insertions, 5 deletions
diff --git a/vespalib/src/tests/stllike/hash_test.cpp b/vespalib/src/tests/stllike/hash_test.cpp index 5cba6f73e10..c530bbdb14a 100644 --- a/vespalib/src/tests/stllike/hash_test.cpp +++ b/vespalib/src/tests/stllike/hash_test.cpp @@ -455,8 +455,8 @@ class WrappedKey public: WrappedKey() : _key() { } WrappedKey(int key) : _key(std::make_unique<const int>(key)) { } - size_t hash() const { return vespalib::hash<int>()(*_key); } - bool operator==(const WrappedKey &rhs) const { return *_key == *rhs._key; } + size_t hash() const noexcept { return vespalib::hash<int>()(*_key); } + bool operator==(const WrappedKey &rhs) const noexcept { return *_key == *rhs._key; } }; } 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; } |