diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/PortID.hpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/PortID.hpp b/src/PortID.hpp index 054008f..8132639 100644 --- a/src/PortID.hpp +++ b/src/PortID.hpp @@ -42,12 +42,6 @@ struct PortID PortID() = default; - PortID(const PortID& copy) - : type(copy.type) - { - memcpy(&id, ©.id, sizeof(id)); - } - #ifdef PATCHAGE_LIBJACK explicit PortID(jack_port_id_t jack_id, bool = false) : type(Type::jack_id) @@ -65,6 +59,22 @@ struct PortID } #endif + PortID(const PortID& copy) + : type(copy.type) + { + memcpy(&id, ©.id, sizeof(id)); + } + + PortID& operator=(const PortID& copy) + { + if (© != this) { + type = copy.type; + memcpy(&id, ©.id, sizeof(id)); + } + + return *this; + } + Type type = Type::nothing; union |