diff options
| author | Linus Jahn <lnj@kaidan.im> | 2022-09-10 19:40:51 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2022-09-12 18:47:23 +0000 |
| commit | 358248b4950131711ae408da9aa30d41c5143e4f (patch) | |
| tree | 02c19a20d30b85d09ba622fa2f2c5254fcac89c4 /src/corelib/tools/qcryptographichash.cpp | |
| parent | 553185e8c3a71d74be368745c3c6a3d5bcffe7e1 (diff) | |
Make QCryptographicHash move constructible
This adds a move constructor, a move assignment operator and a swap
function to QCryptographicHash. This can (to name one example) be useful
when you want to store multiple hashes in a vector.
[ChangeLog][QtCore][QCryptographicHash] Added move constructor, move
assignment operator and swap() function.
Change-Id: Id54594fa69104ec25ad78581f962a021e85531c2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/tools/qcryptographichash.cpp')
| -rw-r--r-- | src/corelib/tools/qcryptographichash.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 8d60be175e1..3f6075f2aaf 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 |
