summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp5
-rw-r--r--searchlib/src/tests/attribute/posting_list_merger/posting_list_merger_test.cpp12
-rw-r--r--searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp9
-rw-r--r--searchlib/src/tests/memoryindex/field_index_remover/field_index_remover_test.cpp4
-rw-r--r--searchlib/src/tests/query/querybuilder_test.cpp4
-rw-r--r--searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp8
-rw-r--r--searchlib/src/tests/transactionlog/chunks_test.cpp2
-rw-r--r--searchlib/src/tests/transactionlog/translogclient_test.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/bitvector_search_cache.h10
-rw-r--r--searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/attribute/interlock.h12
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multivalue.h13
-rw-r--r--searchlib/src/vespa/searchlib/common/gatecallback.h4
-rw-r--r--searchlib/src/vespa/searchlib/common/lid_usage_stats.h4
-rw-r--r--searchlib/src/vespa/searchlib/common/rankedhit.h14
-rw-r--r--searchlib/src/vespa/searchlib/common/scheduletaskcallback.h10
-rw-r--r--searchlib/src/vespa/searchlib/common/tunefileinfo.h22
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/zc4_posting_writer_base.h2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/filechunk.h4
-rw-r--r--searchlib/src/vespa/searchlib/docstore/lid_info.h6
-rw-r--r--searchlib/src/vespa/searchlib/docstore/storebybucket.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/storebybucket.h13
-rw-r--r--searchlib/src/vespa/searchlib/docstore/visitcache.h2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/engine/docsumreply.h6
-rw-r--r--searchlib/src/vespa/searchlib/engine/docsumrequest.h4
-rw-r--r--searchlib/src/vespa/searchlib/engine/searchreply.h8
-rw-r--r--searchlib/src/vespa/searchlib/features/array_parser.h2
-rw-r--r--searchlib/src/vespa/searchlib/features/bm25_feature.h2
-rw-r--r--searchlib/src/vespa/searchlib/features/fieldmatch/computer.h2
-rw-r--r--searchlib/src/vespa/searchlib/fef/rank_program.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/fef/termmatchdatamerger.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/fef/termmatchdatamerger.h22
-rw-r--r--searchlib/src/vespa/searchlib/grouping/hyperloglog.h2
-rw-r--r--searchlib/src/vespa/searchlib/grouping/sketch.h14
-rw-r--r--searchlib/src/vespa/searchlib/index/docidandfeatures.h18
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/field_index_remover.h8
-rw-r--r--searchlib/src/vespa/searchlib/memoryindex/field_inverter.h7
-rw-r--r--searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/query/streaming/hit.h2
-rw-r--r--searchlib/src/vespa/searchlib/query/tree/predicate_query_term.h10
-rw-r--r--searchlib/src/vespa/searchlib/query/tree/queryreplicator.h2
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/global_filter.h6
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.h2
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h11
-rw-r--r--searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/tensor/hnsw_index_utils.h4
-rw-r--r--searchlib/src/vespa/searchlib/tensor/nearest_neighbor_index.h6
-rw-r--r--searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h2
49 files changed, 149 insertions, 171 deletions
diff --git a/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp b/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp
index 65b27dd411a..ae4b55948dc 100644
--- a/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp
+++ b/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp
@@ -62,8 +62,9 @@ struct InputInfo {
std::vector<double> cmp_with;
double usage_probability;
double expected_usage;
- InputInfo(vespalib::stringref name_in, double usage_probability_in, double expected_usage_in)
- : name(name_in), cmp_with(), usage_probability(usage_probability_in), expected_usage(expected_usage_in) {}
+ InputInfo(vespalib::stringref name_in, double usage_probability_in, double expected_usage_in) noexcept
+ : name(name_in), cmp_with(), usage_probability(usage_probability_in), expected_usage(expected_usage_in)
+ {}
double select_value() const {
return cmp_with.empty() ? 0.5 : cmp_with[(cmp_with.size()-1)/2];
}
diff --git a/searchlib/src/tests/attribute/posting_list_merger/posting_list_merger_test.cpp b/searchlib/src/tests/attribute/posting_list_merger/posting_list_merger_test.cpp
index 99b22e02e2e..5976b02c5cf 100644
--- a/searchlib/src/tests/attribute/posting_list_merger/posting_list_merger_test.cpp
+++ b/searchlib/src/tests/attribute/posting_list_merger/posting_list_merger_test.cpp
@@ -11,17 +11,17 @@ using search::attribute::PostingListMerger;
struct Posting {
uint32_t lid;
int32_t weight;
- Posting(uint32_t lid_, int32_t weight_)
+ Posting(uint32_t lid_, int32_t weight_) noexcept
: lid(lid_),
weight(weight_)
{
}
- bool operator==(const Posting &rhs) const {
+ bool operator==(const Posting &rhs) const noexcept {
return ((lid == rhs.lid) && (weight == rhs.weight));
}
- bool operator<(const Posting &rhs) const { return lid < rhs.lid; }
+ bool operator<(const Posting &rhs) const noexcept { return lid < rhs.lid; }
};
std::ostream &operator<<(std::ostream &os, const Posting &posting)
@@ -35,11 +35,11 @@ class WeightedPostingList
{
std::vector<Posting> _entries;
public:
- WeightedPostingList(std::vector<Posting> entries)
+ WeightedPostingList(std::vector<Posting> entries) noexcept
: _entries(std::move(entries))
{
}
- ~WeightedPostingList() { }
+ ~WeightedPostingList() = default;
template <typename Func>
void foreach(Func func) const {
@@ -67,7 +67,7 @@ struct WeightedFixture
{
}
- ~WeightedFixture() { }
+ ~WeightedFixture() = default;
void reserveArray(uint32_t postingsCount, size_t postingsSize) { _merger.reserveArray(postingsCount, postingsSize); }
diff --git a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp
index 87aea2e3e8c..7328fe2c7ff 100644
--- a/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp
+++ b/searchlib/src/tests/attribute/searchable/attribute_searchable_adapter_test.cpp
@@ -140,8 +140,9 @@ struct Result {
uint32_t docid;
double raw_score;
int32_t match_weight;
- Hit(uint32_t id, double raw, int32_t match_weight_in)
- : docid(id), raw_score(raw), match_weight(match_weight_in) {}
+ Hit(uint32_t id, double raw, int32_t match_weight_in) noexcept
+ : docid(id), raw_score(raw), match_weight(match_weight_in)
+ {}
};
size_t est_hits;
bool est_empty;
@@ -590,7 +591,7 @@ TEST("require that attribute weighted set term works") {
TEST("require that predicate query in non-predicate field yields empty.") {
MyAttributeManager attribute_manager = makeAttributeManager("foo");
- PredicateQueryTerm::UP term(new PredicateQueryTerm);
+ auto term = std::make_unique<PredicateQueryTerm>();
SimplePredicateQuery node(std::move(term), field, 0, Weight(1));
Result result = do_search(attribute_manager, node, true);
EXPECT_TRUE(result.est_empty);
@@ -605,7 +606,7 @@ TEST("require that predicate query in predicate field yields results.") {
const_cast<PredicateAttribute::IntervalRange *>(attr->getIntervalRangeVector())[2] = 1u;
MyAttributeManager attribute_manager(attr);
- PredicateQueryTerm::UP term(new PredicateQueryTerm);
+ auto term = std::make_unique<PredicateQueryTerm>();
SimplePredicateQuery node(std::move(term), field, 0, Weight(1));
Result result = do_search(attribute_manager, node, true);
EXPECT_FALSE(result.est_empty);
diff --git a/searchlib/src/tests/memoryindex/field_index_remover/field_index_remover_test.cpp b/searchlib/src/tests/memoryindex/field_index_remover/field_index_remover_test.cpp
index af7ea9be481..584a8121b16 100644
--- a/searchlib/src/tests/memoryindex/field_index_remover/field_index_remover_test.cpp
+++ b/searchlib/src/tests/memoryindex/field_index_remover/field_index_remover_test.cpp
@@ -16,10 +16,10 @@ using namespace search::memoryindex;
struct WordFieldPair {
vespalib::string _word;
uint32_t _fieldId;
- WordFieldPair(vespalib::stringref word, uint32_t fieldId)
+ WordFieldPair(vespalib::stringref word, uint32_t fieldId) noexcept
: _word(word), _fieldId(fieldId)
{}
- bool operator<(const WordFieldPair &rhs) const {
+ bool operator<(const WordFieldPair &rhs) const noexcept {
if (_word != rhs._word) {
return _word < rhs._word;
}
diff --git a/searchlib/src/tests/query/querybuilder_test.cpp b/searchlib/src/tests/query/querybuilder_test.cpp
index 269600d26d4..5a5a5eafb2c 100644
--- a/searchlib/src/tests/query/querybuilder_test.cpp
+++ b/searchlib/src/tests/query/querybuilder_test.cpp
@@ -38,7 +38,7 @@ const uint32_t x_aspect = 0;
const Location location(position, max_distance, x_aspect);
PredicateQueryTerm::UP getPredicateQueryTerm() {
- PredicateQueryTerm::UP pqt(new PredicateQueryTerm);
+ auto pqt = std::make_unique<PredicateQueryTerm>();
pqt->addFeature("key", "value");
pqt->addRangeFeature("key2", 42, 0xfff);
return pqt;
@@ -242,7 +242,7 @@ void checkQueryTreeTypes(Node *node) {
EXPECT_TRUE(checkTerm(string_term, str[5], view[5], id[5], weight[5]));
auto* predicateQuery = as_node<PredicateQuery>(and_node->getChildren()[5]);
- PredicateQueryTerm::UP pqt(new PredicateQueryTerm);
+ auto pqt = std::make_unique<PredicateQueryTerm>();
EXPECT_TRUE(checkTerm(predicateQuery, getPredicateQueryTerm(), view[3], id[3], weight[3]));
auto* dotProduct = as_node<DotProduct>(and_node->getChildren()[6]);
diff --git a/searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp b/searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp
index 28b0d103040..3dd2ec26dea 100644
--- a/searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp
+++ b/searchlib/src/tests/queryeval/predicate/predicate_blueprint_test.cpp
@@ -40,9 +40,9 @@ struct Fixture {
Fixture()
: field(42, 0),
- attribute(new PredicateAttribute("f", attribute::Config(attribute::BasicType::PREDICATE))),
- query(PredicateQueryTerm::UP(new PredicateQueryTerm),
- "view", 0, Weight(1)) {
+ attribute(std::make_shared<PredicateAttribute>("f", attribute::Config(attribute::BasicType::PREDICATE))),
+ query(std::make_unique<PredicateQueryTerm>(),"view", 0, Weight(1))
+ {
query.getTerm()->addFeature("key", "value");
query.getTerm()->addRangeFeature("range_key", 42);
}
@@ -219,7 +219,7 @@ TEST_F("require that blueprint can set up search with subqueries", Fixture) {
std::vector<Interval>{{0x0002ffff}};
f.indexDocument(doc_id, annotations);
- SimplePredicateQuery query(PredicateQueryTerm::UP(new PredicateQueryTerm),
+ SimplePredicateQuery query(std::make_unique<PredicateQueryTerm>(),
"view", 0, Weight(1));
query.getTerm()->addFeature("key", "value", 1);
query.getTerm()->addFeature("key2", "value", 2);
diff --git a/searchlib/src/tests/transactionlog/chunks_test.cpp b/searchlib/src/tests/transactionlog/chunks_test.cpp
index 4a74dd7f5bc..a3cf9f8bd92 100644
--- a/searchlib/src/tests/transactionlog/chunks_test.cpp
+++ b/searchlib/src/tests/transactionlog/chunks_test.cpp
@@ -79,7 +79,7 @@ TEST("test empty commitchunk") {
struct Counter : public search::IDestructorCallback {
std::atomic<uint32_t> & _counter;
- Counter(std::atomic<uint32_t> & counter) : _counter(counter) { _counter++; }
+ Counter(std::atomic<uint32_t> & counter) noexcept : _counter(counter) { _counter++; }
~Counter() override { _counter--; }
};
diff --git a/searchlib/src/tests/transactionlog/translogclient_test.cpp b/searchlib/src/tests/transactionlog/translogclient_test.cpp
index fffb70467a3..e097eebd42c 100644
--- a/searchlib/src/tests/transactionlog/translogclient_test.cpp
+++ b/searchlib/src/tests/transactionlog/translogclient_test.cpp
@@ -311,7 +311,7 @@ using Counter = std::atomic<size_t>;
class CountDone : public IDestructorCallback {
public:
- explicit CountDone(Counter & inFlight) : _inFlight(inFlight) { ++_inFlight; }
+ explicit CountDone(Counter & inFlight) noexcept : _inFlight(inFlight) { ++_inFlight; }
~CountDone() override { --_inFlight; }
private:
Counter & _inFlight;
diff --git a/searchlib/src/vespa/searchlib/attribute/bitvector_search_cache.h b/searchlib/src/vespa/searchlib/attribute/bitvector_search_cache.h
index a889120f8df..1cd07cf4e23 100644
--- a/searchlib/src/vespa/searchlib/attribute/bitvector_search_cache.h
+++ b/searchlib/src/vespa/searchlib/attribute/bitvector_search_cache.h
@@ -8,11 +8,8 @@
#include <memory>
#include <mutex>
-namespace search {
-
-class BitVector;
-
-namespace attribute {
+namespace search { class BitVector; }
+namespace search::attribute {
/**
* Class that caches posting lists (as bit vectors) for a set of search terms.
@@ -31,7 +28,7 @@ public:
ReadGuardUP dmsReadGuard;
BitVectorSP bitVector;
uint32_t docIdLimit;
- Entry(ReadGuardUP dmsReadGuard_, BitVectorSP bitVector_, uint32_t docIdLimit_)
+ Entry(ReadGuardUP dmsReadGuard_, BitVectorSP bitVector_, uint32_t docIdLimit_) noexcept
: dmsReadGuard(std::move(dmsReadGuard_)), bitVector(std::move(bitVector_)), docIdLimit(docIdLimit_) {}
};
@@ -52,4 +49,3 @@ public:
};
}
-}
diff --git a/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp b/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp
index bc0d965bcc1..9c40de26db6 100644
--- a/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/imported_search_context.cpp
@@ -93,7 +93,7 @@ struct WeightedRef {
EntryRef revMapIdx;
int32_t weight;
- WeightedRef(EntryRef revMapIdx_, int32_t weight_)
+ WeightedRef(EntryRef revMapIdx_, int32_t weight_) noexcept
: revMapIdx(revMapIdx_),
weight(weight_)
{
@@ -118,11 +118,11 @@ class ReverseMappingBitVector
const ReverseMapping &_reverseMapping;
EntryRef _revMapIdx;
public:
- ReverseMappingBitVector(const ReverseMapping &reverseMapping, EntryRef revMapIdx)
+ ReverseMappingBitVector(const ReverseMapping &reverseMapping, EntryRef revMapIdx) noexcept
: _reverseMapping(reverseMapping),
_revMapIdx(revMapIdx)
{}
- ~ReverseMappingBitVector() { }
+ ~ReverseMappingBitVector() = default;
template <typename Func>
void foreach_key(Func func) const {
diff --git a/searchlib/src/vespa/searchlib/attribute/interlock.h b/searchlib/src/vespa/searchlib/attribute/interlock.h
index cf9298686c3..30efeaf32fd 100644
--- a/searchlib/src/vespa/searchlib/attribute/interlock.h
+++ b/searchlib/src/vespa/searchlib/attribute/interlock.h
@@ -4,11 +4,7 @@
#include <mutex>
-namespace search
-{
-
-namespace attribute
-{
+namespace search::attribute {
class InterlockGuard;
@@ -35,7 +31,7 @@ class Interlock {
std::mutex _mutex;
friend class InterlockGuard;
public:
- Interlock()
+ Interlock() noexcept
: _mutex()
{
}
@@ -60,6 +56,4 @@ public:
};
-}
-
-}
+} \ No newline at end of file
diff --git a/searchlib/src/vespa/searchlib/attribute/multivalue.h b/searchlib/src/vespa/searchlib/attribute/multivalue.h
index c59f975e00a..54c10bdc7cf 100644
--- a/searchlib/src/vespa/searchlib/attribute/multivalue.h
+++ b/searchlib/src/vespa/searchlib/attribute/multivalue.h
@@ -10,12 +10,9 @@ template <typename T>
class Value {
public:
typedef T ValueType;
- Value()
- : _v()
- {
- }
- Value(T v) : _v(v) { }
- Value(T v, int32_t w) : _v(v) { (void) w; }
+ Value() noexcept : _v() {}
+ Value(T v) noexcept : _v(v) { }
+ Value(T v, int32_t w) noexcept : _v(v) { (void) w; }
T value() const { return _v; }
operator T () const { return _v; }
operator T & () { return _v; }
@@ -36,8 +33,8 @@ template <typename T>
class WeightedValue {
public:
typedef T ValueType;
- WeightedValue() : _v(), _w(1) { }
- WeightedValue(T v, int32_t w) : _v(v), _w(w) { }
+ WeightedValue() noexcept : _v(), _w(1) { }
+ WeightedValue(T v, int32_t w) noexcept : _v(v), _w(w) { }
T value() const { return _v; }
operator T () const { return _v; }
operator T & () { return _v; }
diff --git a/searchlib/src/vespa/searchlib/common/gatecallback.h b/searchlib/src/vespa/searchlib/common/gatecallback.h
index 1e85d796089..b6e7690f820 100644
--- a/searchlib/src/vespa/searchlib/common/gatecallback.h
+++ b/searchlib/src/vespa/searchlib/common/gatecallback.h
@@ -9,7 +9,7 @@ namespace search {
class GateCallback : public IDestructorCallback {
public:
- GateCallback(vespalib::Gate & gate) : _gate(gate) {}
+ GateCallback(vespalib::Gate & gate) noexcept : _gate(gate) {}
~GateCallback() override;
private:
vespalib::Gate & _gate;
@@ -17,7 +17,7 @@ private:
class IgnoreCallback : public IDestructorCallback {
public:
- IgnoreCallback() { }
+ IgnoreCallback() noexcept { }
~IgnoreCallback() override = default;
};
diff --git a/searchlib/src/vespa/searchlib/common/lid_usage_stats.h b/searchlib/src/vespa/searchlib/common/lid_usage_stats.h
index 1dd3881892f..97e16ffe768 100644
--- a/searchlib/src/vespa/searchlib/common/lid_usage_stats.h
+++ b/searchlib/src/vespa/searchlib/common/lid_usage_stats.h
@@ -20,7 +20,7 @@ private:
uint32_t _highestUsedLid;
public:
- LidUsageStats()
+ LidUsageStats() noexcept
: _lidLimit(0),
_usedLids(0),
_lowestFreeLid(0),
@@ -30,7 +30,7 @@ public:
LidUsageStats(uint32_t lidLimit,
uint32_t usedLids,
uint32_t lowestFreeLid,
- uint32_t highestUsedLid)
+ uint32_t highestUsedLid) noexcept
: _lidLimit(lidLimit),
_usedLids(usedLids),
_lowestFreeLid(lowestFreeLid),
diff --git a/searchlib/src/vespa/searchlib/common/rankedhit.h b/searchlib/src/vespa/searchlib/common/rankedhit.h
index 635f6e350a5..8a0efb4ce3c 100644
--- a/searchlib/src/vespa/searchlib/common/rankedhit.h
+++ b/searchlib/src/vespa/searchlib/common/rankedhit.h
@@ -9,8 +9,8 @@
namespace search {
struct RankedHit {
- RankedHit() : _docId(0), _rankValue(zero_rank_value) { }
- RankedHit(unsigned int docId, HitRank rank = zero_rank_value) : _docId(docId), _rankValue(rank) { }
+ RankedHit() noexcept : _docId(0), _rankValue(zero_rank_value) { }
+ RankedHit(unsigned int docId, HitRank rank = zero_rank_value) noexcept : _docId(docId), _rankValue(rank) { }
unsigned int getDocId() const { return _docId & 0x7fffffff; }
bool hasMore() const { return _docId & 0x80000000; }
HitRank getRank() const { return _rankValue; }
@@ -21,13 +21,13 @@ struct RankedHit {
class RankedHitIterator {
public:
- RankedHitIterator(const RankedHit * h, size_t sz) : _h(h), _sz(sz), _pos(0) { }
- bool hasNext() const { return _pos < _sz; }
- uint32_t next() { return _h[_pos++].getDocId(); }
+ RankedHitIterator(const RankedHit * h, size_t sz) noexcept : _h(h), _sz(sz), _pos(0) { }
+ bool hasNext() const noexcept { return _pos < _sz; }
+ uint32_t next() noexcept { return _h[_pos++].getDocId(); }
private:
const RankedHit *_h;
- const size_t _sz;
- size_t _pos;
+ const size_t _sz;
+ size_t _pos;
};
} // namespace search
diff --git a/searchlib/src/vespa/searchlib/common/scheduletaskcallback.h b/searchlib/src/vespa/searchlib/common/scheduletaskcallback.h
index 27bbe751532..00f0d4b29f5 100644
--- a/searchlib/src/vespa/searchlib/common/scheduletaskcallback.h
+++ b/searchlib/src/vespa/searchlib/common/scheduletaskcallback.h
@@ -4,8 +4,7 @@
#include "idestructorcallback.h"
#include <vespa/vespalib/util/executor.h>
-namespace search
-{
+namespace search {
/**
* Class that schedules a task when instance is destroyed. Typically a
@@ -20,12 +19,11 @@ class ScheduleTaskCallback : public IDestructorCallback
vespalib::Executor::Task::UP _task;
public:
ScheduleTaskCallback(vespalib::Executor &executor,
- vespalib::Executor::Task::UP task)
+ vespalib::Executor::Task::UP task) noexcept
: _executor(executor),
_task(std::move(task))
- {
- }
- virtual ~ScheduleTaskCallback() {
+ {}
+ ~ScheduleTaskCallback() override {
_executor.execute(std::move(_task));
}
};
diff --git a/searchlib/src/vespa/searchlib/common/tunefileinfo.h b/searchlib/src/vespa/searchlib/common/tunefileinfo.h
index bcd6765845b..e27290d35de 100644
--- a/searchlib/src/vespa/searchlib/common/tunefileinfo.h
+++ b/searchlib/src/vespa/searchlib/common/tunefileinfo.h
@@ -19,7 +19,7 @@ private:
TuneControl _tuneControl;
public:
- TuneFileSeqRead() : _tuneControl(NORMAL) { }
+ TuneFileSeqRead() noexcept : _tuneControl(NORMAL) { }
void setWantDirectIO() { _tuneControl = DIRECTIO; }
bool getWantDirectIO() const { return _tuneControl == DIRECTIO; }
@@ -62,7 +62,7 @@ private:
TuneControl _tuneControl;
public:
- TuneFileSeqWrite() : _tuneControl(NORMAL) { }
+ TuneFileSeqWrite() noexcept : _tuneControl(NORMAL) { }
void setWantDirectIO() { _tuneControl = DIRECTIO; }
bool getWantDirectIO() const { return _tuneControl == DIRECTIO; }
bool getWantSyncWrites() const { return _tuneControl == OSYNC; }
@@ -99,7 +99,7 @@ private:
int _mmapFlags;
int _advise;
public:
- TuneFileRandRead()
+ TuneFileRandRead() noexcept
: _tuneControl(NORMAL),
_mmapFlags(0),
_advise(0)
@@ -139,9 +139,9 @@ public:
TuneFileSeqRead _read;
TuneFileSeqWrite _write;
- TuneFileIndexing() : _read(), _write() {}
+ TuneFileIndexing() noexcept : _read(), _write() {}
- TuneFileIndexing(const TuneFileSeqRead &r, const TuneFileSeqWrite &w) : _read(r), _write(w) { }
+ TuneFileIndexing(const TuneFileSeqRead &r, const TuneFileSeqWrite &w) noexcept : _read(r), _write(w) { }
bool operator==(const TuneFileIndexing &rhs) const {
return _read == rhs._read && _write == rhs._write;
@@ -161,8 +161,8 @@ class TuneFileSearch
public:
TuneFileRandRead _read;
- TuneFileSearch() : _read() { }
- TuneFileSearch(const TuneFileRandRead &r) : _read(r) { }
+ TuneFileSearch() noexcept : _read() { }
+ TuneFileSearch(const TuneFileRandRead &r) noexcept : _read(r) { }
bool operator==(const TuneFileSearch &rhs) const { return _read == rhs._read; }
bool operator!=(const TuneFileSearch &rhs) const { return _read != rhs._read; }
};
@@ -178,7 +178,7 @@ public:
TuneFileIndexing _indexing;
TuneFileSearch _search;
- TuneFileIndexManager() : _indexing(), _search() { }
+ TuneFileIndexManager() noexcept : _indexing(), _search() { }
bool operator==(const TuneFileIndexManager &rhs) const {
return _indexing == rhs._indexing && _search == rhs._search;
@@ -198,7 +198,7 @@ class TuneFileAttributes
public:
TuneFileSeqWrite _write;
- TuneFileAttributes() : _write() { }
+ TuneFileAttributes() noexcept : _write() { }
bool operator==(const TuneFileAttributes &rhs) const {
return _write == rhs._write;
@@ -220,7 +220,7 @@ public:
TuneFileSeqWrite _write;
TuneFileRandRead _randRead;
- TuneFileSummary() : _seqRead(), _write(), _randRead() { }
+ TuneFileSummary() noexcept : _seqRead(), _write(), _randRead() { }
bool operator==(const TuneFileSummary &rhs) const {
return _seqRead == rhs._seqRead &&
@@ -248,7 +248,7 @@ public:
TuneFileAttributes _attr;
TuneFileSummary _summary;
- TuneFileDocumentDB() : _index(), _attr(), _summary() { }
+ TuneFileDocumentDB() noexcept : _index(), _attr(), _summary() { }
bool operator==(const TuneFileDocumentDB &rhs) const {
return _index == rhs._index &&
diff --git a/searchlib/src/vespa/searchlib/diskindex/zc4_posting_writer_base.h b/searchlib/src/vespa/searchlib/diskindex/zc4_posting_writer_base.h
index e9b1efa5c7d..4e71a8356c0 100644
--- a/searchlib/src/vespa/searchlib/diskindex/zc4_posting_writer_base.h
+++ b/searchlib/src/vespa/searchlib/diskindex/zc4_posting_writer_base.h
@@ -24,7 +24,7 @@ public:
uint32_t _field_length;
uint32_t _num_occs;
uint32_t _features_size;
- DocIdAndFeatureSize(uint32_t doc_id, uint32_t field_length, uint32_t num_occs, uint32_t features_size)
+ DocIdAndFeatureSize(uint32_t doc_id, uint32_t field_length, uint32_t num_occs, uint32_t features_size) noexcept
: _doc_id(doc_id),
_field_length(field_length),
_num_occs(num_occs),
diff --git a/searchlib/src/vespa/searchlib/docstore/filechunk.h b/searchlib/src/vespa/searchlib/docstore/filechunk.h
index b68db801d60..6839423d6db 100644
--- a/searchlib/src/vespa/searchlib/docstore/filechunk.h
+++ b/searchlib/src/vespa/searchlib/docstore/filechunk.h
@@ -76,7 +76,7 @@ public:
using LockGuard = vespalib::LockGuard;
class NameId {
public:
- explicit NameId(size_t id) : _id(id) { }
+ explicit NameId(size_t id) noexcept : _id(id) { }
uint64_t getId() const { return _id; }
vespalib::string createName(const vespalib::string &baseName) const;
bool operator == (const NameId & rhs) const { return _id == rhs._id; }
@@ -90,7 +90,7 @@ public:
};
class FileId {
public:
- explicit FileId(uint32_t id) : _id(id) { }
+ explicit FileId(uint32_t id) noexcept : _id(id) { }
uint32_t getId() const { return _id; }
bool operator != (const FileId & rhs) const { return _id != rhs._id; }
bool operator == (const FileId & rhs) const { return _id == rhs._id; }
diff --git a/searchlib/src/vespa/searchlib/docstore/lid_info.h b/searchlib/src/vespa/searchlib/docstore/lid_info.h
index 10ddd868c41..8444a9e3575 100644
--- a/searchlib/src/vespa/searchlib/docstore/lid_info.h
+++ b/searchlib/src/vespa/searchlib/docstore/lid_info.h
@@ -11,8 +11,8 @@ namespace search {
class LidInfo {
public:
- LidInfo() : _value() { }
- LidInfo(uint64_t rep) { _value.r = rep; }
+ LidInfo() noexcept : _value() { }
+ LidInfo(uint64_t rep) noexcept { _value.r = rep; }
LidInfo(uint32_t fileId, uint32_t chunkId, uint32_t size);
uint32_t getFileId() const { return _value.v.fileId; }
uint32_t getChunkId() const { return _value.v.chunkId; }
@@ -57,7 +57,7 @@ private:
class LidInfoWithLid : public LidInfo {
public:
- LidInfoWithLid(LidInfo lidInfo, uint32_t lid) : LidInfo(lidInfo), _lid(lid) { }
+ LidInfoWithLid(LidInfo lidInfo, uint32_t lid) noexcept : LidInfo(lidInfo), _lid(lid) { }
uint32_t getLid() const { return _lid; }
private:
uint32_t _lid;
diff --git a/searchlib/src/vespa/searchlib/docstore/storebybucket.cpp b/searchlib/src/vespa/searchlib/docstore/storebybucket.cpp
index 5e595d0bb14..d7711b61d78 100644
--- a/searchlib/src/vespa/searchlib/docstore/storebybucket.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/storebybucket.cpp
@@ -12,7 +12,7 @@ using document::BucketId;
using vespalib::makeTask;
using vespalib::makeClosure;
-StoreByBucket::StoreByBucket(MemoryDataStore & backingMemory, Executor & executor, const CompressionConfig & compression)
+StoreByBucket::StoreByBucket(MemoryDataStore & backingMemory, Executor & executor, const CompressionConfig & compression) noexcept
: _chunkSerial(0),
_current(),
_where(),
diff --git a/searchlib/src/vespa/searchlib/docstore/storebybucket.h b/searchlib/src/vespa/searchlib/docstore/storebybucket.h
index 8be0610b588..1365dcb4416 100644
--- a/searchlib/src/vespa/searchlib/docstore/storebybucket.h
+++ b/searchlib/src/vespa/searchlib/docstore/storebybucket.h
@@ -24,9 +24,12 @@ class StoreByBucket
using ConstBufferRef = vespalib::ConstBufferRef;
using CompressionConfig = vespalib::compression::CompressionConfig;
public:
- StoreByBucket(vespalib::MemoryDataStore & backingMemory, const CompressionConfig & compression);
- StoreByBucket(MemoryDataStore & backingMemory, Executor & executor, const CompressionConfig & compression);
- StoreByBucket(StoreByBucket &&) = default;
+ StoreByBucket(MemoryDataStore & backingMemory, Executor & executor, const CompressionConfig & compression) noexcept;
+ //TODO Putting the below move constructor into cpp file fails for some unknown reason. Needs to be resolved.
+ StoreByBucket(StoreByBucket &&) noexcept = default;
+ StoreByBucket(const StoreByBucket &) = delete;
+ StoreByBucket & operator=(StoreByBucket &&) noexcept = delete;
+ StoreByBucket & operator = (const StoreByBucket &) = delete;
~StoreByBucket();
class IWrite {
public:
@@ -52,10 +55,10 @@ private:
void closeChunk(Chunk::UP chunk);
struct Index {
using BucketId=document::BucketId;
- Index(BucketId bucketId, uint32_t id, uint32_t chunkId, uint32_t entry) :
+ Index(BucketId bucketId, uint32_t id, uint32_t chunkId, uint32_t entry) noexcept :
_bucketId(bucketId), _id(id), _chunkId(chunkId), _lid(entry)
{ }
- bool operator < (const Index & b) const {
+ bool operator < (const Index & b) const noexcept {
return BucketId::bucketIdToKey(_bucketId.getRawId()) < BucketId::bucketIdToKey(b._bucketId.getRawId());
}
BucketId _bucketId;
diff --git a/searchlib/src/vespa/searchlib/docstore/visitcache.h b/searchlib/src/vespa/searchlib/docstore/visitcache.h
index 8a06794ee35..25a7be5ee6c 100644
--- a/searchlib/src/vespa/searchlib/docstore/visitcache.h
+++ b/searchlib/src/vespa/searchlib/docstore/visitcache.h
@@ -40,7 +40,7 @@ class BlobSet {
public:
class LidPosition {
public:
- LidPosition(uint32_t lid, uint32_t offset, uint32_t size) : _lid(lid), _offset(offset), _size(size) { }
+ LidPosition(uint32_t lid, uint32_t offset, uint32_t size) noexcept : _lid(lid), _offset(offset), _size(size) { }
uint32_t lid() const { return _lid; }
uint32_t offset() const { return _offset; }
uint32_t size() const { return _size; }
diff --git a/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp b/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp
index 3517595d00a..beece528795 100644
--- a/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/writeablefilechunk.cpp
@@ -204,7 +204,7 @@ seek_past(LidInfoWithLidV::const_iterator begin, LidInfoWithLidV::const_iterator
}
struct LidAndBuffer {
- LidAndBuffer(uint32_t lid, uint32_t sz, vespalib::alloc::Alloc buf) : _lid(lid), _size(sz), _buf(std::move(buf)) {}
+ LidAndBuffer(uint32_t lid, uint32_t sz, vespalib::alloc::Alloc buf) noexcept : _lid(lid), _size(sz), _buf(std::move(buf)) {}
uint32_t _lid;
uint32_t _size;
vespalib::alloc::Alloc _buf;
diff --git a/searchlib/src/vespa/searchlib/engine/docsumreply.h b/searchlib/src/vespa/searchlib/engine/docsumreply.h
index 37431030253..0150b1eda3d 100644
--- a/searchlib/src/vespa/searchlib/engine/docsumreply.h
+++ b/searchlib/src/vespa/searchlib/engine/docsumreply.h
@@ -22,9 +22,9 @@ struct DocsumReply
document::GlobalId gid;
Blob data;
- Docsum() : docid(0), gid(), data(0) {}
- Docsum(document::GlobalId gid_) : docid(0), gid(gid_), data(0) { }
- Docsum(document::GlobalId gid_, const char *buf, uint32_t len) : docid(0), gid(gid_), data(len) {
+ Docsum() noexcept : docid(0), gid(), data(0) {}
+ Docsum(document::GlobalId gid_) noexcept : docid(0), gid(gid_), data(0) { }
+ Docsum(document::GlobalId gid_, const char *buf, uint32_t len) noexcept : docid(0), gid(gid_), data(len) {
memcpy(data.str(), buf, len);
}
Docsum & setData(const char *buf, uint32_t len) {
diff --git a/searchlib/src/vespa/searchlib/engine/docsumrequest.h b/searchlib/src/vespa/searchlib/engine/docsumrequest.h
index 8aa8d036b73..8fe5aa6f465 100644
--- a/searchlib/src/vespa/searchlib/engine/docsumrequest.h
+++ b/searchlib/src/vespa/searchlib/engine/docsumrequest.h
@@ -23,8 +23,8 @@ public:
class Hit {
public:
- Hit() : gid(), docid(0), path(0) {}
- Hit(const document::GlobalId & gid_) : gid(gid_), docid(0), path(0) {}
+ Hit() noexcept : gid(), docid(0), path(0) {}
+ Hit(const document::GlobalId & gid_) noexcept : gid(gid_), docid(0), path(0) {}
document::GlobalId gid;
mutable uint32_t docid; // converted in backend
diff --git a/searchlib/src/vespa/searchlib/engine/searchreply.h b/searchlib/src/vespa/searchlib/engine/searchreply.h
index d9468216a90..531f94d2b6f 100644
--- a/searchlib/src/vespa/searchlib/engine/searchreply.h
+++ b/searchlib/src/vespa/searchlib/engine/searchreply.h
@@ -18,7 +18,7 @@ public:
class Hit
{
public:
- Hit() : gid(), metric(0), path(0), _distributionKey(0) {}
+ Hit() noexcept : gid(), metric(0), path(0), _distributionKey(0) {}
void setDistributionKey(uint32_t key) { _distributionKey = key; }
uint32_t getDistributionKey() const { return _distributionKey; }
document::GlobalId gid;
@@ -30,9 +30,9 @@ public:
class Coverage {
public:
- Coverage() : Coverage(0) { }
- Coverage(uint64_t active) : Coverage(active, active) { }
- Coverage(uint64_t active, uint64_t covered)
+ Coverage() noexcept : Coverage(0) { }
+ Coverage(uint64_t active) noexcept : Coverage(active, active) { }
+ Coverage(uint64_t active, uint64_t covered) noexcept
: _covered(covered), _active(active), _soonActive(active),
_degradeReason(0), _nodesQueried(1), _nodesReplied(1)
{ }
diff --git a/searchlib/src/vespa/searchlib/features/array_parser.h b/searchlib/src/vespa/searchlib/features/array_parser.h
index 8bf6e9ca365..7de766efddc 100644
--- a/searchlib/src/vespa/searchlib/features/array_parser.h
+++ b/searchlib/src/vespa/searchlib/features/array_parser.h
@@ -29,7 +29,7 @@ public:
class ValueAndIndex {
public:
typedef T ValueType;
- ValueAndIndex(T value, uint32_t index) : _value(value), _index(index) { }
+ ValueAndIndex(T value, uint32_t index) noexcept : _value(value), _index(index) { }
T getValue() const { return _value; }
uint32_t getIndex() const { return _index; }
bool operator < (const ValueAndIndex & b) const { return _index < b._index; }
diff --git a/searchlib/src/vespa/searchlib/features/bm25_feature.h b/searchlib/src/vespa/searchlib/features/bm25_feature.h
index 0afd14e7ac8..72dcb7e2ef7 100644
--- a/searchlib/src/vespa/searchlib/features/bm25_feature.h
+++ b/searchlib/src/vespa/searchlib/features/bm25_feature.h
@@ -14,7 +14,7 @@ private:
fef::TermFieldHandle handle;
const fef::TermFieldMatchData* tfmd;
double idf_mul_k1_plus_one;
- QueryTerm(fef::TermFieldHandle handle_, double inverse_doc_freq, double k1_param)
+ QueryTerm(fef::TermFieldHandle handle_, double inverse_doc_freq, double k1_param) noexcept
: handle(handle_),
tfmd(nullptr),
idf_mul_k1_plus_one(inverse_doc_freq * (k1_param + 1))
diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/computer.h b/searchlib/src/vespa/searchlib/features/fieldmatch/computer.h
index e4dbde1248a..a4699b17457 100644
--- a/searchlib/src/vespa/searchlib/features/fieldmatch/computer.h
+++ b/searchlib/src/vespa/searchlib/features/fieldmatch/computer.h
@@ -289,7 +289,7 @@ private:
struct SegmentData {
SegmentData() : segment(), valid(false) {}
- SegmentData(SegmentStart::SP ss, bool v = false) : segment(std::move(ss)), valid(v) {}
+ SegmentData(SegmentStart::SP ss, bool v = false) noexcept : segment(std::move(ss)), valid(v) {}
SegmentStart::SP segment;
bool valid;
};
diff --git a/searchlib/src/vespa/searchlib/fef/rank_program.cpp b/searchlib/src/vespa/searchlib/fef/rank_program.cpp
index 0bc85a63ceb..dd1e774607f 100644
--- a/searchlib/src/vespa/searchlib/fef/rank_program.cpp
+++ b/searchlib/src/vespa/searchlib/fef/rank_program.cpp
@@ -23,7 +23,7 @@ struct Override
BlueprintResolver::FeatureRef ref;
feature_t value;
- Override(const BlueprintResolver::FeatureRef &r, feature_t v)
+ Override(const BlueprintResolver::FeatureRef &r, feature_t v) noexcept
: ref(r), value(v) {}
bool operator<(const Override &rhs) const {
diff --git a/searchlib/src/vespa/searchlib/fef/termmatchdatamerger.cpp b/searchlib/src/vespa/searchlib/fef/termmatchdatamerger.cpp
index 973e11fc0d2..11a5dd80b4c 100644
--- a/searchlib/src/vespa/searchlib/fef/termmatchdatamerger.cpp
+++ b/searchlib/src/vespa/searchlib/fef/termmatchdatamerger.cpp
@@ -24,7 +24,7 @@ TermMatchDataMerger::TermMatchDataMerger(const Inputs &allinputs,
}
}
-TermMatchDataMerger::~TermMatchDataMerger() {}
+TermMatchDataMerger::~TermMatchDataMerger() = default;
void
TermMatchDataMerger::merge(uint32_t docid)
diff --git a/searchlib/src/vespa/searchlib/fef/termmatchdatamerger.h b/searchlib/src/vespa/searchlib/fef/termmatchdatamerger.h
index e0addc374b2..fb129b792b8 100644
--- a/searchlib/src/vespa/searchlib/fef/termmatchdatamerger.h
+++ b/searchlib/src/vespa/searchlib/fef/termmatchdatamerger.h
@@ -6,8 +6,7 @@
#include "termfieldmatchdata.h"
#include <vector>
-namespace search {
-namespace fef {
+namespace search::fef {
class TermMatchDataMerger
{
@@ -16,8 +15,8 @@ public:
const TermFieldMatchData *matchData;
double exactness;
- Input() : matchData(NULL), exactness(0.0) {}
- Input(const TermFieldMatchData *arg_matchData, double arg_exactness)
+ Input() : matchData(nullptr), exactness(0.0) {}
+ Input(const TermFieldMatchData *arg_matchData, double arg_exactness) noexcept
: matchData(arg_matchData), exactness(arg_exactness)
{}
};
@@ -27,21 +26,16 @@ private:
const TermFieldMatchDataArray _output;
std::vector<TermFieldMatchDataPosition> _scratch;
- TermMatchDataMerger(const TermMatchDataMerger &);
- TermMatchDataMerger &operator=(const TermMatchDataMerger &);
-
- void merge(uint32_t docid,
- const Inputs &in,
- TermFieldMatchData &out);
+ void merge(uint32_t docid, const Inputs &in, TermFieldMatchData &out);
public:
+ TermMatchDataMerger(const TermMatchDataMerger &) = delete;
+ TermMatchDataMerger &operator=(const TermMatchDataMerger &) = delete;
- TermMatchDataMerger(const Inputs &allinputs,
- const TermFieldMatchDataArray &outputs);
+ TermMatchDataMerger(const Inputs &allinputs, const TermFieldMatchDataArray &outputs);
~TermMatchDataMerger();
void merge(uint32_t docid);
};
-} // namespace fef
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/grouping/hyperloglog.h b/searchlib/src/vespa/searchlib/grouping/hyperloglog.h
index 931b832c76d..2206f4ccbe1 100644
--- a/searchlib/src/vespa/searchlib/grouping/hyperloglog.h
+++ b/searchlib/src/vespa/searchlib/grouping/hyperloglog.h
@@ -28,7 +28,7 @@ template <int BucketBits = 10, typename HashT = uint32_t>
class ExchangerSketch : public SparseSketch<BucketBits, HashT> {
typename Sketch<BucketBits, HashT>::UP &_sketch_ptr;
- virtual int aggregate(HashT hash) override {
+ int aggregate(HashT hash) override {
if (this->getSize() > SPARSE_SKETCH_LIMIT) {
NormalSketch<BucketBits, HashT> *normal_sketch =
new NormalSketch<BucketBits, HashT>;
diff --git a/searchlib/src/vespa/searchlib/grouping/sketch.h b/searchlib/src/vespa/searchlib/grouping/sketch.h
index 317c1bfef9d..c105b480a3d 100644
--- a/searchlib/src/vespa/searchlib/grouping/sketch.h
+++ b/searchlib/src/vespa/searchlib/grouping/sketch.h
@@ -70,21 +70,21 @@ struct SparseSketch : Sketch<BucketBits, HashT> {
enum { classId = IDENTIFIABLE_CLASSID_NS(search, SparseSketch) };
struct IdentityHash {
- size_t operator()(HashT hash) const { return hash; }
+ size_t operator()(HashT hash) const noexcept { return hash; }
};
std::unordered_set<HashT, IdentityHash> hash_set;
size_t getSize() const { return hash_set.size(); }
- virtual int aggregate(HashT hash) override {
+ int aggregate(HashT hash) override {
return hash_set.insert(hash).second ? 1 : 0;
}
- virtual uint32_t getClassId() const override { return classId; }
- virtual void serialize(vespalib::Serializer &os) const override;
- virtual void deserialize(vespalib::Deserializer &is) override;
+ uint32_t getClassId() const override { return classId; }
+ void serialize(vespalib::Serializer &os) const override;
+ void deserialize(vespalib::Deserializer &is) override;
- virtual bool operator==(const SketchType &other) const override {
+ bool operator==(const SketchType &other) const override {
const SparseSketch<BucketBits, HashT> *other_sparse =
dynamic_cast<const SparseSketch<BucketBits, HashT> *>(&other);
if (!other_sparse) {
@@ -101,7 +101,7 @@ struct SparseSketch : Sketch<BucketBits, HashT> {
return true;
}
- virtual void print(std::ostream &out) const override {
+ void print(std::ostream &out) const override {
out << " (" << hash_set.size() << " elements)";
for (auto hash : hash_set) {
out << " 0x" << std::hex;
diff --git a/searchlib/src/vespa/searchlib/index/docidandfeatures.h b/searchlib/src/vespa/searchlib/index/docidandfeatures.h
index 5372d5ef3aa..6ee80721038 100644
--- a/searchlib/src/vespa/searchlib/index/docidandfeatures.h
+++ b/searchlib/src/vespa/searchlib/index/docidandfeatures.h
@@ -26,14 +26,14 @@ private:
uint32_t _elementLen;
public:
- WordDocElementFeatures()
+ WordDocElementFeatures() noexcept
: _elementId(0u),
_numOccs(0u),
_weight(1),
_elementLen(SEARCHLIB_FEF_UNKNOWN_FIELD_LENGTH)
{}
- WordDocElementFeatures(uint32_t elementId)
+ WordDocElementFeatures(uint32_t elementId) noexcept
: _elementId(elementId),
_numOccs(0u),
_weight(1),
@@ -42,7 +42,7 @@ public:
WordDocElementFeatures(uint32_t elementId,
uint32_t weight,
- uint32_t elementLen)
+ uint32_t elementLen) noexcept
: _elementId(elementId),
_numOccs(0u),
_weight(weight),
@@ -71,11 +71,11 @@ private:
uint32_t _wordPos;
public:
- WordDocElementWordPosFeatures()
+ WordDocElementWordPosFeatures() noexcept
: _wordPos(0u)
{}
- WordDocElementWordPosFeatures(uint32_t wordPos)
+ WordDocElementWordPosFeatures(uint32_t wordPos) noexcept
: _wordPos(wordPos)
{}
@@ -101,17 +101,17 @@ protected:
std::vector<WordDocElementWordPosFeatures> _word_positions;
// Raw data (file format specific, packed)
- RawData _blob; // Feature data for (word, docid) pair
+ RawData _blob; // Feature data for (word, docid) pair
uint32_t _bit_offset; // Offset of feature start ([0..63])
uint32_t _bit_length; // Length of features
- bool _has_raw_data;
+ bool _has_raw_data;
public:
DocIdAndFeatures();
DocIdAndFeatures(const DocIdAndFeatures &);
DocIdAndFeatures & operator = (const DocIdAndFeatures &);
- DocIdAndFeatures(DocIdAndFeatures &&) = default;
- DocIdAndFeatures & operator = (DocIdAndFeatures &&) = default;
+ DocIdAndFeatures(DocIdAndFeatures &&) noexcept = default;
+ DocIdAndFeatures & operator = (DocIdAndFeatures &&) noexcept = default;
~DocIdAndFeatures();
void clear_features() {
diff --git a/searchlib/src/vespa/searchlib/memoryindex/field_index_remover.h b/searchlib/src/vespa/searchlib/memoryindex/field_index_remover.h
index 36d2286cfb1..717f21528bb 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/field_index_remover.h
+++ b/searchlib/src/vespa/searchlib/memoryindex/field_index_remover.h
@@ -21,11 +21,11 @@ private:
struct WordFieldDocTuple {
vespalib::datastore::EntryRef _wordRef;
uint32_t _docId;
- WordFieldDocTuple() :
+ WordFieldDocTuple() noexcept :
_wordRef(0),
_docId(0)
{ }
- WordFieldDocTuple(vespalib::datastore::EntryRef wordRef, uint32_t docId) :
+ WordFieldDocTuple(vespalib::datastore::EntryRef wordRef, uint32_t docId) noexcept :
_wordRef(wordRef),
_docId(docId)
{ }
@@ -44,12 +44,12 @@ private:
CompactWordsStore _store;
CompactWordsStore::Builder::UP _builder;
- std::vector<WordFieldDocTuple> _wordFieldDocTuples;
+ std::vector<WordFieldDocTuple> _wordFieldDocTuples;
const WordStore &_wordStore;
public:
FieldIndexRemover(const WordStore &wordStore);
- ~FieldIndexRemover();
+ ~FieldIndexRemover() override;
void remove(uint32_t docId, IFieldIndexRemoveListener &inverter);
CompactWordsStore &getStore() { return _store; }
const CompactWordsStore &getStore() const { return _store; }
diff --git a/searchlib/src/vespa/searchlib/memoryindex/field_inverter.h b/searchlib/src/vespa/searchlib/memoryindex/field_inverter.h
index 78a1cf6c171..3a18d0c2f8c 100644
--- a/searchlib/src/vespa/searchlib/memoryindex/field_inverter.h
+++ b/searchlib/src/vespa/searchlib/memoryindex/field_inverter.h
@@ -39,7 +39,7 @@ public:
static constexpr uint32_t _elemRemoved =
std::numeric_limits<uint32_t>::max();
- PosInfo()
+ PosInfo() noexcept
: _wordNum(0),
_docId(0),
_elemId(0),
@@ -51,7 +51,7 @@ public:
PosInfo(uint32_t wordRef,
uint32_t docId,
uint32_t elemId,
- uint32_t wordPos, uint32_t elemRef)
+ uint32_t wordPos, uint32_t elemRef) noexcept
: _wordNum(wordRef),
_docId(docId),
_elemId(elemId),
@@ -60,8 +60,7 @@ public:
{
}
- PosInfo(uint32_t wordRef,
- uint32_t docId)
+ PosInfo(uint32_t wordRef, uint32_t docId) noexcept
: _wordNum(wordRef),
_docId(docId),
_elemId(_elemRemoved),
diff --git a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp
index 1820fb0e969..6039a86580c 100644
--- a/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp
+++ b/searchlib/src/vespa/searchlib/parsequery/stackdumpiterator.cpp
@@ -225,7 +225,7 @@ SimpleQueryStackDumpIterator::next()
case ParseItem::ITEM_PREDICATE_QUERY:
try {
_curr_index_name = read_stringref(p);
- _predicate_query_term.reset(new PredicateQueryTerm);
+ _predicate_query_term = std::make_unique<PredicateQueryTerm>();
size_t count = readCompressedPositiveInt(p);
for (size_t i = 0; i < count; ++i) {
diff --git a/searchlib/src/vespa/searchlib/query/streaming/hit.h b/searchlib/src/vespa/searchlib/query/streaming/hit.h
index 64b71a70df9..fabaa3ad50c 100644
--- a/searchlib/src/vespa/searchlib/query/streaming/hit.h
+++ b/searchlib/src/vespa/searchlib/query/streaming/hit.h
@@ -9,7 +9,7 @@ namespace search::streaming {
class Hit
{
public:
- Hit(uint32_t pos_, uint32_t context_, uint32_t elemId_, int32_t weight_)
+ Hit(uint32_t pos_, uint32_t context_, uint32_t elemId_, int32_t weight_) noexcept
: _position(pos_ | (context_<<24)),
_elemId(elemId_),
_weight(weight_)
diff --git a/searchlib/src/vespa/searchlib/query/tree/predicate_query_term.h b/searchlib/src/vespa/searchlib/query/tree/predicate_query_term.h
index 0a92546e414..8602eb1ac57 100644
--- a/searchlib/src/vespa/searchlib/query/tree/predicate_query_term.h
+++ b/searchlib/src/vespa/searchlib/query/tree/predicate_query_term.h
@@ -22,7 +22,7 @@ class PredicateQueryTerm {
public:
Entry(const vespalib::string &key, const ValueType &value,
- uint64_t sub_query_bitmap = ALL_SUB_QUERIES)
+ uint64_t sub_query_bitmap = ALL_SUB_QUERIES) noexcept
: _key(key), _value(value), _sub_query_bitmap(sub_query_bitmap) {}
vespalib::string getKey() const { return _key; }
@@ -41,13 +41,7 @@ class PredicateQueryTerm {
public:
typedef std::unique_ptr<PredicateQueryTerm> UP;
- PredicateQueryTerm() : _features(), _range_features() {}
-
- PredicateQueryTerm(const std::vector<Entry<vespalib::string>> &features,
- const std::vector<Entry<uint64_t>> &range_features)
- : _features(features),
- _range_features(range_features) {
- }
+ PredicateQueryTerm() noexcept : _features(), _range_features() {}
void addFeature(const vespalib::string &key, const vespalib::string &value,
uint64_t sub_query_bitmask = ALL_SUB_QUERIES) {
diff --git a/searchlib/src/vespa/searchlib/query/tree/queryreplicator.h b/searchlib/src/vespa/searchlib/query/tree/queryreplicator.h
index 9289df7cbe9..600249c3e1e 100644
--- a/searchlib/src/vespa/searchlib/query/tree/queryreplicator.h
+++ b/searchlib/src/vespa/searchlib/query/tree/queryreplicator.h
@@ -153,7 +153,7 @@ private:
void visit(PredicateQuery &node) override {
replicate(node, _builder.addPredicateQuery(
- PredicateQueryTerm::UP(new PredicateQueryTerm(*node.getTerm())),
+ std::make_unique<PredicateQueryTerm>(*node.getTerm()),
node.getView(), node.getId(), node.getWeight()));
}
diff --git a/searchlib/src/vespa/searchlib/queryeval/global_filter.h b/searchlib/src/vespa/searchlib/queryeval/global_filter.h
index b30162affa7..3e57ded4898 100644
--- a/searchlib/src/vespa/searchlib/queryeval/global_filter.h
+++ b/searchlib/src/vespa/searchlib/queryeval/global_filter.h
@@ -21,15 +21,15 @@ private:
struct ctor_tag {};
std::unique_ptr<search::BitVector> bit_vector;
+public:
GlobalFilter(const GlobalFilter &) = delete;
GlobalFilter(GlobalFilter &&) = delete;
-public:
- GlobalFilter(ctor_tag, std::unique_ptr<search::BitVector> bit_vector_in)
+ GlobalFilter(ctor_tag, std::unique_ptr<search::BitVector> bit_vector_in) noexcept
: bit_vector(std::move(bit_vector_in))
{}
- GlobalFilter(ctor_tag) : bit_vector() {}
+ GlobalFilter(ctor_tag) noexcept : bit_vector() {}
~GlobalFilter() {}
diff --git a/searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.h b/searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.h
index f209e0f7fd8..b9812036637 100644
--- a/searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.h
+++ b/searchlib/src/vespa/searchlib/queryeval/sourceblendersearch.h
@@ -29,7 +29,7 @@ public:
SearchIterator *search;
uint32_t sourceId;
Child() : search(nullptr), sourceId(0) { }
- Child(SearchIterator *s, uint32_t id) : search(s), sourceId(id) {}
+ Child(SearchIterator *s, uint32_t id) noexcept : search(s), sourceId(id) {}
};
typedef std::vector<Child> Children;
diff --git a/searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h b/searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h
index 071d6d99470..937e7a089df 100644
--- a/searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h
+++ b/searchlib/src/vespa/searchlib/queryeval/wand/wand_parts.h
@@ -41,11 +41,12 @@ struct Term {
uint32_t estHits;
fef::TermFieldMatchData *matchData;
score_t maxScore = 0.0; // <- only used by rise wand test
- Term(SearchIterator *s, int32_t w, uint32_t e, fef::TermFieldMatchData *tfmd)
- : search(s), weight(w), estHits(e), matchData(tfmd) {}
- Term() : Term(nullptr, 0, 0, nullptr){}
- Term(SearchIterator *s, int32_t w, uint32_t e) : Term(s, w, e, nullptr) {}
- Term(SearchIterator::UP s, int32_t w, uint32_t e) : Term(s.release(), w, e, nullptr) {}
+ Term(SearchIterator *s, int32_t w, uint32_t e, fef::TermFieldMatchData *tfmd) noexcept
+ : search(s), weight(w), estHits(e), matchData(tfmd)
+ {}
+ Term() noexcept : Term(nullptr, 0, 0, nullptr){}
+ Term(SearchIterator *s, int32_t w, uint32_t e) noexcept : Term(s, w, e, nullptr) {}
+ Term(SearchIterator::UP s, int32_t w, uint32_t e) noexcept : Term(s.release(), w, e, nullptr) {}
};
//-----------------------------------------------------------------------------
diff --git a/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp b/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp
index 9def5a7b0a8..6488b525b7c 100644
--- a/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp
@@ -40,7 +40,7 @@ struct PairDist {
uint32_t id_first;
uint32_t id_second;
double distance;
- PairDist(uint32_t i1, uint32_t i2, double d)
+ PairDist(uint32_t i1, uint32_t i2, double d) noexcept
: id_first(i1), id_second(i2), distance(d)
{}
};
diff --git a/searchlib/src/vespa/searchlib/tensor/hnsw_index_utils.h b/searchlib/src/vespa/searchlib/tensor/hnsw_index_utils.h
index 99266505780..d206b055071 100644
--- a/searchlib/src/vespa/searchlib/tensor/hnsw_index_utils.h
+++ b/searchlib/src/vespa/searchlib/tensor/hnsw_index_utils.h
@@ -16,9 +16,9 @@ struct HnswCandidate {
uint32_t docid;
HnswGraph::NodeRef node_ref;
double distance;
- HnswCandidate(uint32_t docid_in, double distance_in)
+ HnswCandidate(uint32_t docid_in, double distance_in) noexcept
: docid(docid_in), node_ref(), distance(distance_in) {}
- HnswCandidate(uint32_t docid_in, HnswGraph::NodeRef node_ref_in, double distance_in)
+ HnswCandidate(uint32_t docid_in, HnswGraph::NodeRef node_ref_in, double distance_in) noexcept
: docid(docid_in), node_ref(node_ref_in), distance(distance_in) {}
};
diff --git a/searchlib/src/vespa/searchlib/tensor/nearest_neighbor_index.h b/searchlib/src/vespa/searchlib/tensor/nearest_neighbor_index.h
index 74f14cea21b..c14da0d058f 100644
--- a/searchlib/src/vespa/searchlib/tensor/nearest_neighbor_index.h
+++ b/searchlib/src/vespa/searchlib/tensor/nearest_neighbor_index.h
@@ -29,12 +29,12 @@ public:
struct Neighbor {
uint32_t docid;
double distance;
- Neighbor(uint32_t id, double dist)
+ Neighbor(uint32_t id, double dist) noexcept
: docid(id), distance(dist)
{}
- Neighbor() : docid(0), distance(0.0) {}
+ Neighbor() noexcept : docid(0), distance(0.0) {}
};
- virtual ~NearestNeighborIndex() {}
+ virtual ~NearestNeighborIndex() = default;
virtual void add_document(uint32_t docid) = 0;
/**
diff --git a/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h b/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h
index e2fcbf444a2..0a04e1e79fd 100644
--- a/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h
+++ b/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.h
@@ -23,7 +23,7 @@ namespace search {
struct MockDocumentMetaStoreContext : public IDocumentMetaStoreContext {
mutable size_t get_read_guard_cnt;
- MockDocumentMetaStoreContext() : get_read_guard_cnt(0) {}
+ MockDocumentMetaStoreContext() noexcept : get_read_guard_cnt(0) {}
IReadGuard::UP getReadGuard() const override;
};