summaryrefslogtreecommitdiffstats
path: root/staging_vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-10-06 21:25:06 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-10-06 21:34:26 +0000
commit7ef38647f60cf0e6750bbddaacd09aa8f279d77d (patch)
treecb1cbe25af89221588f22db4ef3f804cecd6c26c /staging_vespalib
parent1c3d83a0499b854887e8a998cc33dd1101519738 (diff)
Use noexcept as advise by gcc -Wnoexcept
Diffstat (limited to 'staging_vespalib')
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/snapshots.cpp6
-rw-r--r--staging_vespalib/src/vespa/vespalib/metrics/snapshots.h8
-rw-r--r--staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h10
3 files changed, 10 insertions, 14 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/snapshots.cpp b/staging_vespalib/src/vespa/vespalib/metrics/snapshots.cpp
index 46de7beaac3..1e491fa29e3 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/snapshots.cpp
+++ b/staging_vespalib/src/vespa/vespalib/metrics/snapshots.cpp
@@ -1,8 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "snapshots.h"
-namespace vespalib {
-namespace metrics {
+namespace vespalib::metrics {
-} // namespace vespalib::metrics
-} // namespace vespalib
+}
diff --git a/staging_vespalib/src/vespa/vespalib/metrics/snapshots.h b/staging_vespalib/src/vespa/vespalib/metrics/snapshots.h
index ee5fc942e65..ae8ec7e6531 100644
--- a/staging_vespalib/src/vespa/vespalib/metrics/snapshots.h
+++ b/staging_vespalib/src/vespa/vespalib/metrics/snapshots.h
@@ -6,8 +6,7 @@
#include "counter_aggregator.h"
#include "gauge_aggregator.h"
-namespace vespalib {
-namespace metrics {
+namespace vespalib::metrics {
class DimensionBinding {
private:
@@ -17,7 +16,7 @@ public:
const vespalib::string &dimensionName() const { return _dimensionName; }
const vespalib::string &labelValue() const { return _labelValue; }
DimensionBinding(const vespalib::string &a,
- const vespalib::string &v)
+ const vespalib::string &v) noexcept
: _dimensionName(a), _labelValue(v)
{}
~DimensionBinding() {}
@@ -105,5 +104,4 @@ public:
void add(const GaugeSnapshot &entry) { _gauges.push_back(entry); }
};
-} // namespace vespalib::metrics
-} // namespace vespalib
+}
diff --git a/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h b/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h
index d1450f957de..593f9366b0b 100644
--- a/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h
+++ b/staging_vespalib/src/vespa/vespalib/net/json_handler_repo.h
@@ -35,7 +35,7 @@ private:
const JsonGetHandler *handler;
Hook(size_t seq_in,
vespalib::stringref prefix_in,
- const JsonGetHandler &handler_in)
+ const JsonGetHandler &handler_in) noexcept
: seq(seq_in), path_prefix(prefix_in), handler(&handler_in) {}
bool operator <(const Hook &rhs) const {
if (path_prefix.size() == rhs.path_prefix.size()) {
@@ -48,7 +48,7 @@ private:
struct Resource {
size_t seq;
vespalib::string path;
- Resource(size_t seq_in, vespalib::stringref path_in)
+ Resource(size_t seq_in, vespalib::stringref path_in) noexcept
: seq(seq_in), path(path_in) {}
};
@@ -58,7 +58,7 @@ private:
size_t seq;
std::vector<Hook> hooks;
std::vector<Resource> root_resources;
- State() : lock(), seq(0), hooks(), root_resources() {}
+ State() noexcept : lock(), seq(0), hooks(), root_resources() {}
size_t bind(vespalib::stringref path_prefix,
const JsonGetHandler &get_handler);
size_t add_root_resource(vespalib::stringref path);
@@ -68,8 +68,8 @@ private:
struct Unbinder : Token {
State::SP state;
size_t my_seq;
- Unbinder(State::SP state_in, size_t my_seq_in)
- : state(state_in), my_seq(my_seq_in) {}
+ Unbinder(State::SP state_in, size_t my_seq_in) noexcept
+ : state(std::move(state_in)), my_seq(my_seq_in) {}
~Unbinder() override {
state->unbind(my_seq);
}