diff options
-rw-r--r-- | src/websockets/qwebsocketcorsauthenticator.cpp | 11 | ||||
-rw-r--r-- | src/websockets/qwebsocketcorsauthenticator.h | 12 |
2 files changed, 9 insertions, 14 deletions
diff --git a/src/websockets/qwebsocketcorsauthenticator.cpp b/src/websockets/qwebsocketcorsauthenticator.cpp index 5d1cde4..4de1922 100644 --- a/src/websockets/qwebsocketcorsauthenticator.cpp +++ b/src/websockets/qwebsocketcorsauthenticator.cpp @@ -122,33 +122,30 @@ QWebSocketCorsAuthenticator::operator =(const QWebSocketCorsAuthenticator &other return *this; } -#ifdef Q_COMPILER_RVALUE_REFS /*! Move-constructs a QWebSocketCorsAuthenticator, making it point at the same object \a other was pointing to. */ -QWebSocketCorsAuthenticator::QWebSocketCorsAuthenticator(QWebSocketCorsAuthenticator &&other) : - d_ptr(other.d_ptr.take()) +QWebSocketCorsAuthenticator::QWebSocketCorsAuthenticator(QWebSocketCorsAuthenticator &&other) noexcept : + d_ptr(other.d_ptr.release()) {} /*! Move-assigns \a other to this instance. */ QWebSocketCorsAuthenticator & -QWebSocketCorsAuthenticator::operator =(QWebSocketCorsAuthenticator &&other) +QWebSocketCorsAuthenticator::operator =(QWebSocketCorsAuthenticator &&other) noexcept { qSwap(d_ptr, other.d_ptr); return *this; } -#endif - /*! Swaps \a other with this authenticator. This operation is very fast and never fails. */ -void QWebSocketCorsAuthenticator::swap(QWebSocketCorsAuthenticator &other) +void QWebSocketCorsAuthenticator::swap(QWebSocketCorsAuthenticator &other) noexcept { if (&other != this) qSwap(d_ptr, other.d_ptr); diff --git a/src/websockets/qwebsocketcorsauthenticator.h b/src/websockets/qwebsocketcorsauthenticator.h index b58316a..0185d5a 100644 --- a/src/websockets/qwebsocketcorsauthenticator.h +++ b/src/websockets/qwebsocketcorsauthenticator.h @@ -40,7 +40,7 @@ #define QWEBSOCKETCORSAUTHENTICATOR_H #include "QtWebSockets/qwebsockets_global.h" -#include <QtCore/QScopedPointer> +#include <memory> QT_BEGIN_NAMESPACE @@ -55,12 +55,10 @@ public: ~QWebSocketCorsAuthenticator(); explicit QWebSocketCorsAuthenticator(const QWebSocketCorsAuthenticator &other); -#ifdef Q_COMPILER_RVALUE_REFS - QWebSocketCorsAuthenticator(QWebSocketCorsAuthenticator &&other); - QWebSocketCorsAuthenticator &operator =(QWebSocketCorsAuthenticator &&other); -#endif + QWebSocketCorsAuthenticator(QWebSocketCorsAuthenticator &&other) noexcept; + QWebSocketCorsAuthenticator &operator =(QWebSocketCorsAuthenticator &&other) noexcept; - void swap(QWebSocketCorsAuthenticator &other); + void swap(QWebSocketCorsAuthenticator &other) noexcept; QWebSocketCorsAuthenticator &operator =(const QWebSocketCorsAuthenticator &other); @@ -70,7 +68,7 @@ public: bool allowed() const; private: - QScopedPointer<QWebSocketCorsAuthenticatorPrivate> d_ptr; + std::unique_ptr<QWebSocketCorsAuthenticatorPrivate> d_ptr; }; QT_END_NAMESPACE |