Fix reliance on deprecated implicit assignment operators

Either both, or neither, a copy constructor and assignment operator should be
defined.  This fixes Wdeprecated-copy warnings.
This commit is contained in:
David Robillard 2020-12-01 12:03:38 +01:00
parent 91f15300b8
commit 0404876d7b
3 changed files with 6 additions and 3 deletions

View File

@ -746,17 +746,19 @@ enum MidiPortFlags {
struct LatencyRange {
LatencyRange () : min (0), max (0) {}
LatencyRange (const LatencyRange& other) : min (other.min), max (other.max) {}
uint32_t min; //< samples
uint32_t max; //< samples
bool operator==(const LatencyRange& other) {
bool operator==(const LatencyRange& other) const {
return (min == other.min && max == other.max);
}
void operator=(const LatencyRange& other) {
LatencyRange& operator=(const LatencyRange& other) {
min = other.min;
max = other.max;
return *this;
}
};

View File

@ -311,7 +311,7 @@ Region::Region (boost::shared_ptr<const Region> other)
use_sources (other->_sources);
set_master_sources (other->_master_sources);
_position_lock_style = other->_position_lock_style;
_position_lock_style = other->_position_lock_style.val();
_first_edit = other->_first_edit;
_start = other->_start;

View File

@ -343,6 +343,7 @@ private:
/* no copy-construction */
EnumProperty (EnumProperty const &);
EnumProperty& operator= (EnumProperty const &);
};
/** A Property which holds a shared_ptr to a Stateful object,