Add moves to the ModKey::Parameters
This commit is contained in:
parent
09333b3cec
commit
31103d11a2
2 changed files with 20 additions and 2 deletions
|
|
@ -38,6 +38,24 @@ ModKey::Parameters& ModKey::Parameters::operator=(const Parameters& other) noexc
|
|||
return *this;
|
||||
}
|
||||
|
||||
ModKey::Parameters::Parameters(Parameters&& other) noexcept
|
||||
{
|
||||
std::memcpy(
|
||||
static_cast<RawParameters*>(this),
|
||||
static_cast<const RawParameters*>(&other),
|
||||
sizeof(RawParameters));
|
||||
}
|
||||
|
||||
ModKey::Parameters& ModKey::Parameters::operator=(Parameters&& other) noexcept
|
||||
{
|
||||
if (this != &other)
|
||||
std::memcpy(
|
||||
static_cast<RawParameters*>(this),
|
||||
static_cast<const RawParameters*>(&other),
|
||||
sizeof(RawParameters));
|
||||
return *this;
|
||||
}
|
||||
|
||||
ModKey ModKey::createCC(uint16_t cc, uint8_t curve, uint8_t smooth, float step)
|
||||
{
|
||||
ModKey::Parameters p;
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ public:
|
|||
Parameters(const Parameters& other) noexcept;
|
||||
Parameters& operator=(const Parameters& other) noexcept;
|
||||
|
||||
Parameters(Parameters&&) = delete;
|
||||
Parameters &operator=(Parameters&&) = delete;
|
||||
Parameters(Parameters&&) noexcept;
|
||||
Parameters &operator=(Parameters&&) noexcept;
|
||||
|
||||
bool operator==(const Parameters& other) const noexcept
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue