Add noexcept qualifications in src/common

Apparently this can actually make a difference in some cases, and the
C++ Core Guideliens recommend doing this on all default constructors,
destructors, and all functions that can not throw (and thus also don't
allocate).
This commit is contained in:
Robbert van der Helm
2021-05-14 17:12:24 +02:00
parent db6ecdbbd4
commit 59ba2aeb5f
126 changed files with 536 additions and 515 deletions
@@ -16,12 +16,12 @@
#include "parameter-finder.h"
YaParameterFinder::ConstructArgs::ConstructArgs() {}
YaParameterFinder::ConstructArgs::ConstructArgs() noexcept {}
YaParameterFinder::ConstructArgs::ConstructArgs(
Steinberg::IPtr<Steinberg::FUnknown> object)
Steinberg::IPtr<Steinberg::FUnknown> object) noexcept
: supported(
Steinberg::FUnknownPtr<Steinberg::Vst::IParameterFinder>(object)) {}
YaParameterFinder::YaParameterFinder(const ConstructArgs&& args)
YaParameterFinder::YaParameterFinder(const ConstructArgs&& args) noexcept
: arguments(std::move(args)) {}
@@ -34,13 +34,13 @@ class YaParameterFinder : public Steinberg::Vst::IParameterFinder {
* These are the arguments for creating a `YaParameterFinder`.
*/
struct ConstructArgs {
ConstructArgs();
ConstructArgs() noexcept;
/**
* Check whether an existing implementation implements
* `IParameterFinder` and read arguments from it.
*/
ConstructArgs(Steinberg::IPtr<Steinberg::FUnknown> object);
ConstructArgs(Steinberg::IPtr<Steinberg::FUnknown> object) noexcept;
/**
* Whether the object supported this interface.
@@ -57,9 +57,9 @@ class YaParameterFinder : public Steinberg::Vst::IParameterFinder {
* Instantiate this instance with arguments read from another interface
* implementation.
*/
YaParameterFinder(const ConstructArgs&& args);
YaParameterFinder(const ConstructArgs&& args) noexcept;
inline bool supported() const { return arguments.supported; }
inline bool supported() const noexcept { return arguments.supported; }
/**
* The response code and editor size returned by a call to
@@ -16,13 +16,13 @@
#include "plug-view-content-scale-support.h"
YaPlugViewContentScaleSupport::ConstructArgs::ConstructArgs() {}
YaPlugViewContentScaleSupport::ConstructArgs::ConstructArgs() noexcept {}
YaPlugViewContentScaleSupport::ConstructArgs::ConstructArgs(
Steinberg::IPtr<Steinberg::FUnknown> object)
Steinberg::IPtr<Steinberg::FUnknown> object) noexcept
: supported(Steinberg::FUnknownPtr<Steinberg::IPlugViewContentScaleSupport>(
object)) {}
YaPlugViewContentScaleSupport::YaPlugViewContentScaleSupport(
const ConstructArgs&& args)
const ConstructArgs&& args) noexcept
: arguments(std::move(args)) {}
@@ -35,13 +35,13 @@ class YaPlugViewContentScaleSupport
* These are the arguments for creating a `YaPlugViewContentScaleSupport`.
*/
struct ConstructArgs {
ConstructArgs();
ConstructArgs() noexcept;
/**
* Check whether an existing implementation implements
* `IPlugViewContentScaleSupport` and read arguments from it.
*/
ConstructArgs(Steinberg::IPtr<Steinberg::FUnknown> object);
ConstructArgs(Steinberg::IPtr<Steinberg::FUnknown> object) noexcept;
/**
* Whether the object supported this interface.
@@ -58,9 +58,9 @@ class YaPlugViewContentScaleSupport
* Instantiate this instance with arguments read from another interface
* implementation.
*/
YaPlugViewContentScaleSupport(const ConstructArgs&& args);
YaPlugViewContentScaleSupport(const ConstructArgs&& args) noexcept;
inline bool supported() const { return arguments.supported; }
inline bool supported() const noexcept { return arguments.supported; }
/**
* Message to pass through a call to
@@ -16,11 +16,11 @@
#include "plug-view.h"
YaPlugView::ConstructArgs::ConstructArgs() {}
YaPlugView::ConstructArgs::ConstructArgs() noexcept {}
YaPlugView::ConstructArgs::ConstructArgs(
Steinberg::IPtr<Steinberg::FUnknown> object)
Steinberg::IPtr<Steinberg::FUnknown> object) noexcept
: supported(Steinberg::FUnknownPtr<Steinberg::IPlugView>(object)) {}
YaPlugView::YaPlugView(const ConstructArgs&& args)
YaPlugView::YaPlugView(const ConstructArgs&& args) noexcept
: arguments(std::move(args)) {}
@@ -36,13 +36,13 @@ class YaPlugView : public Steinberg::IPlugView {
* These are the arguments for creating a `YaPlugView`.
*/
struct ConstructArgs {
ConstructArgs();
ConstructArgs() noexcept;
/**
* Check whether an existing implementation implements `IPlugView` and
* read arguments from it.
*/
ConstructArgs(Steinberg::IPtr<Steinberg::FUnknown> object);
ConstructArgs(Steinberg::IPtr<Steinberg::FUnknown> object) noexcept;
/**
* Whether the object supported this interface.
@@ -59,9 +59,9 @@ class YaPlugView : public Steinberg::IPlugView {
* Instantiate this instance with arguments read from another interface
* implementation.
*/
YaPlugView(const ConstructArgs&& args);
YaPlugView(const ConstructArgs&& args) noexcept;
inline bool supported() const { return arguments.supported; }
inline bool supported() const noexcept { return arguments.supported; }
/**
* Message to pass through a call to