mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-10 22:32:10 +02:00
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:
@@ -16,12 +16,12 @@
|
||||
|
||||
#include "host-application.h"
|
||||
|
||||
YaHostApplication::ConstructArgs::ConstructArgs() {}
|
||||
YaHostApplication::ConstructArgs::ConstructArgs() noexcept {}
|
||||
|
||||
YaHostApplication::ConstructArgs::ConstructArgs(
|
||||
Steinberg::IPtr<Steinberg::FUnknown> object)
|
||||
Steinberg::IPtr<Steinberg::FUnknown> object) noexcept
|
||||
: supported(
|
||||
Steinberg::FUnknownPtr<Steinberg::Vst::IHostApplication>(object)) {}
|
||||
|
||||
YaHostApplication::YaHostApplication(const ConstructArgs&& args)
|
||||
YaHostApplication::YaHostApplication(const ConstructArgs&& args) noexcept
|
||||
: arguments(std::move(args)) {}
|
||||
|
||||
@@ -38,13 +38,13 @@ class YaHostApplication : public Steinberg::Vst::IHostApplication {
|
||||
* These are the arguments for creating a `YaHostApplication`.
|
||||
*/
|
||||
struct ConstructArgs {
|
||||
ConstructArgs();
|
||||
ConstructArgs() noexcept;
|
||||
|
||||
/**
|
||||
* Check whether an existing implementation implements
|
||||
* `IHostApplication` and read arguments from it.
|
||||
*/
|
||||
ConstructArgs(Steinberg::IPtr<Steinberg::FUnknown> object);
|
||||
ConstructArgs(Steinberg::IPtr<Steinberg::FUnknown> object) noexcept;
|
||||
|
||||
/**
|
||||
* Whether the object supported this interface.
|
||||
@@ -61,9 +61,9 @@ class YaHostApplication : public Steinberg::Vst::IHostApplication {
|
||||
* Instantiate this instance with arguments read from another interface
|
||||
* implementation.
|
||||
*/
|
||||
YaHostApplication(const ConstructArgs&& args);
|
||||
YaHostApplication(const ConstructArgs&& args) noexcept;
|
||||
|
||||
inline bool supported() const { return arguments.supported; }
|
||||
inline bool supported() const noexcept { return arguments.supported; }
|
||||
|
||||
/**
|
||||
* The response code and resulting value for a call to
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
#include "plug-interface-support.h"
|
||||
|
||||
YaPlugInterfaceSupport::ConstructArgs::ConstructArgs() {}
|
||||
YaPlugInterfaceSupport::ConstructArgs::ConstructArgs() noexcept {}
|
||||
|
||||
YaPlugInterfaceSupport::ConstructArgs::ConstructArgs(
|
||||
Steinberg::IPtr<Steinberg::FUnknown> object)
|
||||
Steinberg::IPtr<Steinberg::FUnknown> object) noexcept
|
||||
: supported(Steinberg::FUnknownPtr<Steinberg::Vst::IPlugInterfaceSupport>(
|
||||
object)) {}
|
||||
|
||||
YaPlugInterfaceSupport::YaPlugInterfaceSupport(const ConstructArgs&& args)
|
||||
YaPlugInterfaceSupport::YaPlugInterfaceSupport(const ConstructArgs&& args) noexcept
|
||||
: arguments(std::move(args)) {}
|
||||
|
||||
@@ -35,13 +35,13 @@ class YaPlugInterfaceSupport : public Steinberg::Vst::IPlugInterfaceSupport {
|
||||
* These are the arguments for creating a `YaPlugInterfaceSupport`.
|
||||
*/
|
||||
struct ConstructArgs {
|
||||
ConstructArgs();
|
||||
ConstructArgs() noexcept;
|
||||
|
||||
/**
|
||||
* Check whether an existing implementation implements
|
||||
* `IPlugInterfaceSupport` 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 YaPlugInterfaceSupport : public Steinberg::Vst::IPlugInterfaceSupport {
|
||||
* Instantiate this instance with arguments read from another interface
|
||||
* implementation.
|
||||
*/
|
||||
YaPlugInterfaceSupport(const ConstructArgs&& args);
|
||||
YaPlugInterfaceSupport(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
|
||||
|
||||
Reference in New Issue
Block a user