aboutsummaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2021-02-04 21:19:03 +0100
committerTor Egge <Tor.Egge@broadpark.no>2021-02-04 21:19:03 +0100
commit7c2ca2ac4c30377dd0fa45ad62ac23476cdee13b (patch)
tree40838fedf90637a0f1eb2e6082b21f58ed49d3ae /eval
parent147115c0242f0ebd3614fe0afa83f32cfdfd66af (diff)
Use noexcept specifier for simple lambdas.
Diffstat (limited to 'eval')
-rw-r--r--eval/src/tests/instruction/dense_inplace_join_function/dense_inplace_join_function_test.cpp2
-rw-r--r--eval/src/tests/instruction/dense_xw_product_function/dense_xw_product_function_test.cpp4
-rw-r--r--eval/src/vespa/eval/eval/test/gen_spec.cpp6
3 files changed, 6 insertions, 6 deletions
diff --git a/eval/src/tests/instruction/dense_inplace_join_function/dense_inplace_join_function_test.cpp b/eval/src/tests/instruction/dense_inplace_join_function/dense_inplace_join_function_test.cpp
index 327d90f16e8..a1fea41858c 100644
--- a/eval/src/tests/instruction/dense_inplace_join_function/dense_inplace_join_function_test.cpp
+++ b/eval/src/tests/instruction/dense_inplace_join_function/dense_inplace_join_function_test.cpp
@@ -15,7 +15,7 @@ using namespace vespalib::eval::tensor_function;
const ValueBuilderFactory &prod_factory = FastValueBuilderFactory::get();
-GenSpec::seq_t glb = [] (size_t) {
+GenSpec::seq_t glb = [] (size_t) noexcept {
static double seq_value = 0.0;
seq_value += 1.0;
return seq_value;
diff --git a/eval/src/tests/instruction/dense_xw_product_function/dense_xw_product_function_test.cpp b/eval/src/tests/instruction/dense_xw_product_function/dense_xw_product_function_test.cpp
index 74ee559b5dc..35f6b7b1eb8 100644
--- a/eval/src/tests/instruction/dense_xw_product_function/dense_xw_product_function_test.cpp
+++ b/eval/src/tests/instruction/dense_xw_product_function/dense_xw_product_function_test.cpp
@@ -24,8 +24,8 @@ struct First {
operator bool() const { return value; }
};
-GenSpec::seq_t my_vec_seq = [] (size_t i) { return (3.0 + i) * 7.0; };
-GenSpec::seq_t my_mat_seq = [] (size_t i) { return (5.0 + i) * 43.0; };
+GenSpec::seq_t my_vec_seq = [] (size_t i) noexcept { return (3.0 + i) * 7.0; };
+GenSpec::seq_t my_mat_seq = [] (size_t i) noexcept { return (5.0 + i) * 43.0; };
void add_vector(EvalFixture::ParamRepo &repo, const char *d1, size_t s1) {
auto name = make_string("%s%zu", d1, s1);
diff --git a/eval/src/vespa/eval/eval/test/gen_spec.cpp b/eval/src/vespa/eval/eval/test/gen_spec.cpp
index 5ef4896d694..2f28f559051 100644
--- a/eval/src/vespa/eval/eval/test/gen_spec.cpp
+++ b/eval/src/vespa/eval/eval/test/gen_spec.cpp
@@ -11,11 +11,11 @@ namespace vespalib::eval::test {
//-----------------------------------------------------------------------------
Sequence N(double bias) {
- return [bias](size_t i) { return (i + bias); };
+ return [bias](size_t i) noexcept { return (i + bias); };
}
Sequence AX_B(double a, double b) {
- return [a,b](size_t i) { return (a * i) + b; };
+ return [a,b](size_t i) noexcept { return (a * i) + b; };
}
Sequence Div16(const Sequence &seq) {
@@ -36,7 +36,7 @@ Sequence SigmoidF(const Sequence &seq) {
Sequence Seq(const std::vector<double> &seq) {
assert(!seq.empty());
- return [seq](size_t i) { return seq[i % seq.size()]; };
+ return [seq](size_t i) noexcept { return seq[i % seq.size()]; };
}
//-----------------------------------------------------------------------------