diff options
author | Tor Egge <Tor.Egge@online.no> | 2022-02-26 22:02:17 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2022-02-26 22:02:29 +0100 |
commit | 5269c399d694e2ab45bf3e76f86cea4d7de0ab17 (patch) | |
tree | c04075c3546f2cc3578245c190a1a8bbf58b4779 /searchlib | |
parent | e5f4e91644625fa092e2f74c57faa740adbc8f62 (diff) |
Stop using std::binary_function (searchlib).
Diffstat (limited to 'searchlib')
10 files changed, 13 insertions, 17 deletions
diff --git a/searchlib/src/tests/queryeval/weak_and/rise_wand.h b/searchlib/src/tests/queryeval/weak_and/rise_wand.h index 87f59eb3d78..7a5e46c05ea 100644 --- a/searchlib/src/tests/queryeval/weak_and/rise_wand.h +++ b/searchlib/src/tests/queryeval/weak_and/rise_wand.h @@ -36,7 +36,7 @@ public: private: // comparator class that compares two streams. The variables a and b are // logically indices into the streams vector. - class StreamComparator : public std::binary_function<uint16_t, uint16_t, bool> + class StreamComparator { private: const docid_t *_streamDocIds; diff --git a/searchlib/src/tests/sort/sort_test.cpp b/searchlib/src/tests/sort/sort_test.cpp index 54a3542e82b..9c48498eae9 100644 --- a/searchlib/src/tests/sort/sort_test.cpp +++ b/searchlib/src/tests/sort/sort_test.cpp @@ -48,7 +48,7 @@ struct LoadedStrings } }; - class ValueCompare : public std::binary_function<LoadedStrings, LoadedStrings, bool> { + class ValueCompare { public: bool operator() (const LoadedStrings & x, const LoadedStrings & y) const { return strcmp(x._value, y._value) < 0; diff --git a/searchlib/src/vespa/searchlib/aggregation/group.h b/searchlib/src/vespa/searchlib/aggregation/group.h index 4b06bcd8cae..202c5085133 100644 --- a/searchlib/src/vespa/searchlib/aggregation/group.h +++ b/searchlib/src/vespa/searchlib/aggregation/group.h @@ -39,7 +39,7 @@ public: using UP = std::unique_ptr<Group>; typedef Group * ChildP; typedef ChildP * GroupList; - struct GroupEqual : public std::binary_function<ChildP, ChildP, bool> { + struct GroupEqual { GroupEqual(const GroupList * v) : _v(v) { } bool operator()(uint32_t a, uint32_t b) { return (*_v)[a]->getId().cmpFast((*_v)[b]->getId()) == 0; } bool operator()(const Group & a, uint32_t b) { return a.getId().cmpFast((*_v)[b]->getId()) == 0; } diff --git a/searchlib/src/vespa/searchlib/attribute/attrvector.cpp b/searchlib/src/vespa/searchlib/attribute/attrvector.cpp index 6b692ee4b27..0179841e7fa 100644 --- a/searchlib/src/vespa/searchlib/attribute/attrvector.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attrvector.cpp @@ -99,7 +99,7 @@ void StringDirectAttribute::onSave(IAttributeSaveTarget & saveTarget) } } -class stringComp : public std::binary_function<uint32_t, uint32_t, bool> { +class stringComp { public: stringComp(const char * buffer) : _buffer(buffer) { } bool operator()(uint32_t x, uint32_t y) const { return strcmp(_buffer+x, _buffer+y) < 0; } diff --git a/searchlib/src/vespa/searchlib/attribute/loadedenumvalue.h b/searchlib/src/vespa/searchlib/attribute/loadedenumvalue.h index fdf9ab624ad..96bdc147559 100644 --- a/searchlib/src/vespa/searchlib/attribute/loadedenumvalue.h +++ b/searchlib/src/vespa/searchlib/attribute/loadedenumvalue.h @@ -33,9 +33,7 @@ public: } }; - class EnumCompare : public std::binary_function<LoadedEnumAttribute, - LoadedEnumAttribute, - bool> + class EnumCompare { public: bool diff --git a/searchlib/src/vespa/searchlib/attribute/loadednumericvalue.h b/searchlib/src/vespa/searchlib/attribute/loadednumericvalue.h index bfc636d79b9..934d20d57b2 100644 --- a/searchlib/src/vespa/searchlib/attribute/loadednumericvalue.h +++ b/searchlib/src/vespa/searchlib/attribute/loadednumericvalue.h @@ -20,7 +20,7 @@ struct LoadedNumericValue : public LoadedValue<T> { LoadedNumericValue() : LoadedValue<T>() { } - class ValueCompare : public std::binary_function<LoadedNumericValue<T>, LoadedNumericValue<T>, bool> + class ValueCompare { public: bool operator()(const LoadedNumericValue<T> &x, const LoadedNumericValue<T> &y) const { diff --git a/searchlib/src/vespa/searchlib/attribute/loadedvalue.h b/searchlib/src/vespa/searchlib/attribute/loadedvalue.h index b8f938838d2..ab20c9fbe69 100644 --- a/searchlib/src/vespa/searchlib/attribute/loadedvalue.h +++ b/searchlib/src/vespa/searchlib/attribute/loadedvalue.h @@ -40,9 +40,7 @@ public: } }; - class DocOrderCompare : public std::binary_function<LoadedValue<T>, - LoadedValue<T>, - bool> + class DocOrderCompare { public: bool diff --git a/searchlib/src/vespa/searchlib/attribute/stringbase.cpp b/searchlib/src/vespa/searchlib/attribute/stringbase.cpp index ec9b212fcf8..57882ddf1ae 100644 --- a/searchlib/src/vespa/searchlib/attribute/stringbase.cpp +++ b/searchlib/src/vespa/searchlib/attribute/stringbase.cpp @@ -107,7 +107,7 @@ public: } }; -class StdSortDataCharCompare : public std::binary_function<SortDataChar, SortDataChar, bool> +class StdSortDataCharCompare { public: bool operator() (const SortDataChar & x, const SortDataChar & y) const { diff --git a/searchlib/src/vespa/searchlib/common/sortresults.cpp b/searchlib/src/vespa/searchlib/common/sortresults.cpp index 7510ae162ce..8a9af3af828 100644 --- a/searchlib/src/vespa/searchlib/common/sortresults.cpp +++ b/searchlib/src/vespa/searchlib/common/sortresults.cpp @@ -425,7 +425,7 @@ FastS_insertion_sort(T a[], uint32_t n, Compare *compobj) } } -class StdSortDataCompare : public std::binary_function<FastS_SortSpec::SortData, FastS_SortSpec::SortData, bool> +class StdSortDataCompare { public: StdSortDataCompare(const uint8_t * s) : _sortSpec(s) { } diff --git a/searchlib/src/vespa/searchlib/expression/resultvector.h b/searchlib/src/vespa/searchlib/expression/resultvector.h index 171659993ac..81d73e9b1f5 100644 --- a/searchlib/src/vespa/searchlib/expression/resultvector.h +++ b/searchlib/src/vespa/searchlib/expression/resultvector.h @@ -57,20 +57,20 @@ private: template <typename B> struct cmpT { - struct less : public std::binary_function<B, B, bool> { + struct less { bool operator()(const B & a, const B & b) { return a.cmp(b) < 0; } }; - struct equal : public std::binary_function<B, B, bool> { + struct equal { bool operator()(const B & a, const B & b) { return a.cmp(b) == 0; } }; }; template <typename B, typename V> struct contains { - struct less : public std::binary_function<B, V, bool> { + struct less { bool operator()(const B & a, const V & b) { return a.contains(b) < 0; } }; - struct equal : public std::binary_function<B, V, bool> { + struct equal { bool operator()(const B & a, const V & b) { return a.contains(b) == 0; } }; }; |