summaryrefslogtreecommitdiff
path: root/libs/ardour/chan_mapping.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-12-09 22:59:40 +0100
committerDavid Robillard <d@drobilla.net>2019-12-09 23:25:59 +0100
commit8ec3e5fb540f7d79a6f6ca2bd113bbc3743e954b (patch)
tree80bbdd3c69b2d8d1de6584a2493f3774db3edcf0 /libs/ardour/chan_mapping.cc
parent39bdde42504984b7367a0709789c4785e37bf6ea (diff)
Fix deprecated-copy warnings
It's long been a guideline (and IIRC a Weff-c++ warning) that either all, or none, of the copy methods should be defined, but this became a standard warning in GCC9. Presumably to account for a later language change though I'm not sure which. I don't remember why the ChanMapping copy constructor can't just be a simple copy (it's just a map of POD), but figure it's safer to just copy what that does.
Diffstat (limited to 'libs/ardour/chan_mapping.cc')
-rw-r--r--libs/ardour/chan_mapping.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/ardour/chan_mapping.cc b/libs/ardour/chan_mapping.cc
index 3ccc92d42a..d907efe732 100644
--- a/libs/ardour/chan_mapping.cc
+++ b/libs/ardour/chan_mapping.cc
@@ -67,6 +67,22 @@ ChanMapping::ChanMapping (const XMLNode& node)
}
}
+
+ChanMapping ChanMapping::operator=(const ChanMapping& other)
+{
+ _mappings.clear();
+
+ const ChanMapping::Mappings& mp (other.mappings());
+ for (Mappings::const_iterator tm = mp.begin(); tm != mp.end(); ++tm) {
+ for (TypeMapping::const_iterator i = tm->second.begin(); i != tm->second.end(); ++i) {
+ set (tm->first, i->first, i->second);
+ }
+ }
+
+ _mappings = other._mappings;
+ return *this;
+}
+
uint32_t
ChanMapping::get(DataType t, uint32_t from, bool* valid) const
{