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/QXmppPresence.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/base/QXmppPresence.cpp') diff --git a/src/base/QXmppPresence.cpp b/src/base/QXmppPresence.cpp index 25c6410c..202dd2a3 100644 --- a/src/base/QXmppPresence.cpp +++ b/src/base/QXmppPresence.cpp @@ -76,27 +76,25 @@ QXmppPresencePrivate::QXmppPresencePrivate() { } +/// /// Constructs a QXmppPresence. /// -/// \param type - QXmppPresence::QXmppPresence(QXmppPresence::Type type) : d(new QXmppPresencePrivate) { d->type = type; } -/// Constructs a copy of \a other. - +/// Copy-constructor. QXmppPresence::QXmppPresence(const QXmppPresence &other) = default; - +/// Move-constructor. +QXmppPresence::QXmppPresence(QXmppPresence &&) = default; /// Destroys a QXmppPresence. - QXmppPresence::~QXmppPresence() = default; - -/// Assigns \a other to this presence. - +/// Assignemnt operator. QXmppPresence &QXmppPresence::operator=(const QXmppPresence &other) = default; +/// Move-assignemnt operator. +QXmppPresence &QXmppPresence::operator=(QXmppPresence &&) = default; /// /// Indicates if the QXmppStanza is a stanza in the XMPP sence (i. e. a message, -- cgit v1.2.3