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/QXmppRosterIq.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/base/QXmppRosterIq.cpp') diff --git a/src/base/QXmppRosterIq.cpp b/src/base/QXmppRosterIq.cpp index d886dff0..28f7572d 100644 --- a/src/base/QXmppRosterIq.cpp +++ b/src/base/QXmppRosterIq.cpp @@ -29,11 +29,13 @@ QXmppRosterIq::QXmppRosterIq() /// Default copy-constructor QXmppRosterIq::QXmppRosterIq(const QXmppRosterIq &) = default; - +/// Default move-constructor +QXmppRosterIq::QXmppRosterIq(QXmppRosterIq &&) = default; QXmppRosterIq::~QXmppRosterIq() = default; - /// Default assignment operator QXmppRosterIq &QXmppRosterIq::operator=(const QXmppRosterIq &) = default; +/// Default move-assignment operator +QXmppRosterIq &QXmppRosterIq::operator=(QXmppRosterIq &&) = default; /// /// Adds an item to the roster IQ. @@ -176,11 +178,13 @@ QXmppRosterIq::Item::Item() /// Default copy-constructor QXmppRosterIq::Item::Item(const QXmppRosterIq::Item &other) = default; - +/// Default move-constructor +QXmppRosterIq::Item::Item(QXmppRosterIq::Item &&) = default; QXmppRosterIq::Item::~Item() = default; - /// Default assignment operator QXmppRosterIq::Item &QXmppRosterIq::Item::operator=(const Item &other) = default; +/// Default assignment operator +QXmppRosterIq::Item &QXmppRosterIq::Item::operator=(Item &&) = default; /// /// Returns the bareJid of the roster entry. -- cgit v1.2.3