diff options
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qcryptographichash.cpp | 33 | ||||
-rw-r--r-- | src/corelib/tools/qcryptographichash.h | 4 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 8d60be175e..3f6075f2aa 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -316,6 +316,18 @@ QCryptographicHash::QCryptographicHash(Algorithm method) } /*! + \fn QCryptographicHash::QCryptographicHash(QCryptographicHash &&other) + + Move-constructs a new QCryptographicHash from \a other. + + \note The moved-from object \a other is placed in a + partially-formed state, in which the only valid operations are + destruction and assignment of a new value. + + \since 6.5 +*/ + +/*! Destroys the object. */ QCryptographicHash::~QCryptographicHash() @@ -324,6 +336,27 @@ QCryptographicHash::~QCryptographicHash() } /*! + \fn QCryptographicHash &QCryptographicHash::operator=(QCryptographicHash &&other) + + Move-assigns \a other to this QCryptographicHash instance. + + \note The moved-from object \a other is placed in a + partially-formed state, in which the only valid operations are + destruction and assignment of a new value. + + \since 6.5 +*/ + +/*! + \fn void QCryptographicHash::swap(QCryptographicHash &other) + + Swaps cryptographic hash \a other with this cryptographic hash. This + operation is very fast and never fails. + + \since 6.5 +*/ + +/*! Resets the object. */ void QCryptographicHash::reset() noexcept diff --git a/src/corelib/tools/qcryptographichash.h b/src/corelib/tools/qcryptographichash.h index f5710015cf..94fc82783b 100644 --- a/src/corelib/tools/qcryptographichash.h +++ b/src/corelib/tools/qcryptographichash.h @@ -64,8 +64,12 @@ public: Q_ENUM(Algorithm) explicit QCryptographicHash(Algorithm method); + QCryptographicHash(QCryptographicHash &&other) noexcept : d(std::exchange(other.d, nullptr)) {} ~QCryptographicHash(); + QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QCryptographicHash) + void swap(QCryptographicHash &other) noexcept { qt_ptr_swap(d, other.d); } + void reset() noexcept; #if QT_DEPRECATED_SINCE(6, 4) |