aboutsummaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2021-12-11 02:45:14 +0100
committerTor Egge <Tor.Egge@online.no>2021-12-11 02:45:14 +0100
commit0109b1a5f3e300cbeb151a91bef027b406cace39 (patch)
tree87bfe7484f54023265da902e4cfef6b2384d2eb8 /eval
parent60b142c007083c773e910b44cc57d65e7f2c9274 (diff)
Add noexcept specifiers.
Diffstat (limited to 'eval')
-rw-r--r--eval/src/tests/ann/for-sift-hit.h2
-rw-r--r--eval/src/tests/ann/xp-lsh-nns.cpp2
-rw-r--r--eval/src/vespa/eval/eval/aggr.h14
3 files changed, 9 insertions, 9 deletions
diff --git a/eval/src/tests/ann/for-sift-hit.h b/eval/src/tests/ann/for-sift-hit.h
index 0c920fe8109..4002dff84ee 100644
--- a/eval/src/tests/ann/for-sift-hit.h
+++ b/eval/src/tests/ann/for-sift-hit.h
@@ -5,6 +5,6 @@
struct Hit {
uint32_t docid;
double distance;
- Hit() : docid(0u), distance(0.0) {}
+ Hit() noexcept : docid(0u), distance(0.0) {}
Hit(int id, double dist) : docid(id), distance(dist) {}
};
diff --git a/eval/src/tests/ann/xp-lsh-nns.cpp b/eval/src/tests/ann/xp-lsh-nns.cpp
index bdc61a39610..1557da0b84c 100644
--- a/eval/src/tests/ann/xp-lsh-nns.cpp
+++ b/eval/src/tests/ann/xp-lsh-nns.cpp
@@ -130,7 +130,7 @@ struct LshHit {
double distance;
uint32_t docid;
int hash_distance;
- LshHit() : distance(0.0), docid(0u), hash_distance(0) {}
+ LshHit() noexcept : distance(0.0), docid(0u), hash_distance(0) {}
LshHit(int id, double dist, int hd = 0)
: distance(dist), docid(id), hash_distance(hd) {}
};
diff --git a/eval/src/vespa/eval/eval/aggr.h b/eval/src/vespa/eval/eval/aggr.h
index a932d0ac932..133d9b520cd 100644
--- a/eval/src/vespa/eval/eval/aggr.h
+++ b/eval/src/vespa/eval/eval/aggr.h
@@ -90,7 +90,7 @@ private:
size_t _cnt;
public:
using value_type = T;
- constexpr Avg() : _sum{0}, _cnt{0} {}
+ constexpr Avg() noexcept : _sum{0}, _cnt{0} {}
constexpr Avg(T value) : _sum{value}, _cnt{1} {}
constexpr void sample(T value) {
_sum += value;
@@ -109,7 +109,7 @@ private:
size_t _cnt;
public:
using value_type = T;
- constexpr Count() : _cnt{0} {}
+ constexpr Count() noexcept : _cnt{0} {}
constexpr Count(T) : _cnt{1} {}
constexpr void sample(T) { ++_cnt; }
constexpr void merge(const Count &rhs) { _cnt += rhs._cnt; }
@@ -122,7 +122,7 @@ private:
T _prod;
public:
using value_type = T;
- constexpr Prod() : _prod{null_value()} {}
+ constexpr Prod() noexcept : _prod{null_value()} {}
constexpr Prod(T value) : _prod{value} {}
constexpr void sample(T value) { _prod = combine(_prod, value); }
constexpr void merge(const Prod &rhs) { _prod = combine(_prod, rhs._prod); }
@@ -137,7 +137,7 @@ private:
T _sum;
public:
using value_type = T;
- constexpr Sum() : _sum{null_value()} {}
+ constexpr Sum() noexcept : _sum{null_value()} {}
constexpr Sum(T value) : _sum{value} {}
constexpr void sample(T value) { _sum = combine(_sum, value); }
constexpr void merge(const Sum &rhs) { _sum = combine(_sum, rhs._sum); }
@@ -152,7 +152,7 @@ private:
T _max;
public:
using value_type = T;
- constexpr Max() : _max{null_value()} {}
+ constexpr Max() noexcept : _max{null_value()} {}
constexpr Max(T value) : _max{value} {}
constexpr void sample(T value) { _max = combine(_max, value); }
constexpr void merge(const Max &rhs) { _max = combine(_max, rhs._max); }
@@ -167,7 +167,7 @@ private:
std::vector<T> _seen;
public:
using value_type = T;
- constexpr Median() : _seen() {}
+ constexpr Median() noexcept : _seen() {}
constexpr Median(T value) : _seen({value}) {}
constexpr void sample(T value) { _seen.push_back(value); }
constexpr void merge(const Median &rhs) {
@@ -205,7 +205,7 @@ private:
T _min;
public:
using value_type = T;
- constexpr Min() : _min{null_value()} {}
+ constexpr Min() noexcept : _min{null_value()} {}
constexpr Min(T value) : _min{value} {}
constexpr void sample(T value) { _min = combine(_min, value); }
constexpr void merge(const Min &rhs) { _min = combine(_min, rhs._min); }