From 31ef165cbbf918ba0ddd00f86c6dee257a0b936b Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Fri, 17 Jun 2022 18:26:01 +0200 Subject: Add move constructors and move assignment operators everywhere This is so std::move() on implicitly-shared types actually moves the content and doesn't call the copy ctor/assignment operator. --- src/base/QXmppDiscoveryIq.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/base/QXmppDiscoveryIq.cpp') diff --git a/src/base/QXmppDiscoveryIq.cpp b/src/base/QXmppDiscoveryIq.cpp index 2e4586a3..93e1c444 100644 --- a/src/base/QXmppDiscoveryIq.cpp +++ b/src/base/QXmppDiscoveryIq.cpp @@ -60,11 +60,13 @@ QXmppDiscoveryIq::Identity::Identity() /// Default copy-constructor QXmppDiscoveryIq::Identity::Identity(const QXmppDiscoveryIq::Identity &other) = default; - +/// Default move-constructor +QXmppDiscoveryIq::Identity::Identity(QXmppDiscoveryIq::Identity &&) = default; QXmppDiscoveryIq::Identity::~Identity() = default; - /// Default assignment operator QXmppDiscoveryIq::Identity &QXmppDiscoveryIq::Identity::operator=(const QXmppDiscoveryIq::Identity &) = default; +/// Default move-assignment operator +QXmppDiscoveryIq::Identity &QXmppDiscoveryIq::Identity::operator=(QXmppDiscoveryIq::Identity &&) = default; /// /// Returns the category (e.g. "account", "client", "conference", etc.) of the @@ -168,11 +170,13 @@ QXmppDiscoveryIq::Item::Item() /// Default copy-constructor QXmppDiscoveryIq::Item::Item(const QXmppDiscoveryIq::Item &) = default; - +/// Default move-constructor +QXmppDiscoveryIq::Item::Item(QXmppDiscoveryIq::Item &&) = default; QXmppDiscoveryIq::Item::~Item() = default; - /// Default assignment operator QXmppDiscoveryIq::Item &QXmppDiscoveryIq::Item::operator=(const QXmppDiscoveryIq::Item &) = default; +/// Default move-assignment operator +QXmppDiscoveryIq::Item &QXmppDiscoveryIq::Item::operator=(QXmppDiscoveryIq::Item &&) = default; /// /// Returns the jid of the item. @@ -258,11 +262,13 @@ QXmppDiscoveryIq::QXmppDiscoveryIq() /// Default copy-constructor QXmppDiscoveryIq::QXmppDiscoveryIq(const QXmppDiscoveryIq &) = default; - +/// Default move-constructor +QXmppDiscoveryIq::QXmppDiscoveryIq(QXmppDiscoveryIq &&) = default; QXmppDiscoveryIq::~QXmppDiscoveryIq() = default; - /// Default assignment operator QXmppDiscoveryIq &QXmppDiscoveryIq::operator=(const QXmppDiscoveryIq &) = default; +/// Default move-assignment operator +QXmppDiscoveryIq &QXmppDiscoveryIq::operator=(QXmppDiscoveryIq &&) = default; /// /// Returns the features of the service. -- cgit v1.2.3