coverity: add move operations

CID 1521171: Missing move assignment operator

Signed-off-by: Rosen Penev <rosenp@gmail.com>
main
Rosen Penev 2 years ago
parent b6f07ba102
commit afbd9e7a76

@ -308,6 +308,9 @@ class EXIV2API ExifKey : public Key {
~ExifKey() override;
//@}
ExifKey(ExifKey&& rhs);
ExifKey& operator=(ExifKey&& rhs);
//! @name Manipulators
//@{
/*!

@ -264,6 +264,9 @@ ExifKey::ExifKey(const std::string& key) : p_(std::make_unique<Impl>()) {
ExifKey::ExifKey(const ExifKey& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
}
ExifKey::ExifKey(ExifKey&& rhs) : p_(std::make_unique<Impl>(*rhs.p_)) {
}
ExifKey::~ExifKey() = default;
ExifKey& ExifKey::operator=(const ExifKey& rhs) {
@ -274,6 +277,14 @@ ExifKey& ExifKey::operator=(const ExifKey& rhs) {
return *this;
}
ExifKey& ExifKey::operator=(ExifKey&& rhs) {
if (this == &rhs)
return *this;
*p_ = *rhs.p_;
Key::operator=(std::move(rhs));
return *this;
}
void ExifKey::setIdx(int idx) {
p_->idx_ = idx;
}

Loading…
Cancel
Save