From 9126ed67acf17bb2009430cb6de25b2ffd783d8e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 18 Aug 2022 01:18:34 -0400 Subject: Make empty methods and trivial constructors noexcept --- include/ingen/LV2Features.hpp | 2 +- include/ingen/Module.hpp | 3 ++- include/ingen/Tee.hpp | 2 +- include/ingen/client/ClientStore.hpp | 14 +++++++------- include/ingen/memory.hpp | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/ingen/LV2Features.hpp b/include/ingen/LV2Features.hpp index f61b9b85..61183932 100644 --- a/include/ingen/LV2Features.hpp +++ b/include/ingen/LV2Features.hpp @@ -52,7 +52,7 @@ public: class EmptyFeature : public Feature { public: - explicit EmptyFeature(const char* uri) : _uri(uri) {} + explicit EmptyFeature(const char* uri) noexcept : _uri(uri) {} const char* uri() const override { return _uri; } diff --git a/include/ingen/Module.hpp b/include/ingen/Module.hpp index 149c25f9..8fe7b923 100644 --- a/include/ingen/Module.hpp +++ b/include/ingen/Module.hpp @@ -33,7 +33,8 @@ class World; */ class INGEN_API Module { public: - Module() : library(nullptr) {} + Module() noexcept : library(nullptr) {} + virtual ~Module() = default; Module(const Module&) = delete; diff --git a/include/ingen/Tee.hpp b/include/ingen/Tee.hpp index 1e6805cc..2158190f 100644 --- a/include/ingen/Tee.hpp +++ b/include/ingen/Tee.hpp @@ -34,7 +34,7 @@ class Tee : public Interface public: using Sinks = std::vector>; - explicit Tee(Sinks sinks) : _sinks(std::move(sinks)) {} + explicit Tee(Sinks sinks) noexcept : _sinks(std::move(sinks)) {} std::shared_ptr respondee() const override { return _sinks.front()->respondee(); diff --git a/include/ingen/client/ClientStore.hpp b/include/ingen/client/ClientStore.hpp index 3aec363f..83cce726 100644 --- a/include/ingen/client/ClientStore.hpp +++ b/include/ingen/client/ClientStore.hpp @@ -78,22 +78,22 @@ public: void message(const Message& msg) override; - void operator()(const BundleBegin&) {} - void operator()(const BundleEnd&) {} + void operator()(const BundleBegin&) noexcept {} + void operator()(const BundleEnd&) noexcept {} void operator()(const Connect&); void operator()(const Copy&); void operator()(const Del&); void operator()(const Delta&); void operator()(const Disconnect&); void operator()(const DisconnectAll&); - void operator()(const Error&) {} - void operator()(const Get&) {} + void operator()(const Error&) noexcept {} + void operator()(const Get&) noexcept {} void operator()(const Move&); void operator()(const Put&); - void operator()(const Redo&) {} - void operator()(const Response&) {} + void operator()(const Redo&) noexcept {} + void operator()(const Response&) noexcept {} void operator()(const SetProperty&); - void operator()(const Undo&) {} + void operator()(const Undo&) noexcept {} INGEN_SIGNAL(new_object, void, std::shared_ptr) INGEN_SIGNAL(new_plugin, void, std::shared_ptr) diff --git a/include/ingen/memory.hpp b/include/ingen/memory.hpp index 7d2e1db0..a1dba436 100644 --- a/include/ingen/memory.hpp +++ b/include/ingen/memory.hpp @@ -22,10 +22,10 @@ namespace ingen { template -void NullDeleter(T* ptr) {} +void NullDeleter(T* ptr) noexcept {} template -struct FreeDeleter { void operator()(T* const ptr) { free(ptr); } }; +struct FreeDeleter { void operator()(T* const ptr) noexcept { free(ptr); } }; } // namespace ingen -- cgit v1.2.1