diff options
| author | Ivan Solovev <ivan.solovev@qt.io> | 2024-07-09 09:23:22 +0000 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2024-07-09 09:27:01 +0000 |
| commit | 0ac0b412c754e53d167716f207be9d76a7fe16be (patch) | |
| tree | 820786446a89b9e5f0de3d39803a708d71a1cf49 /src/corelib/tools/qsharedpointer.cpp | |
| parent | b4bb4449aea7592afdb9b9134bb90c40fe29735a (diff) | |
Revert "QSharedPointer: Use new comparison helper macros"
This reverts commit 2e817647f2f9c87800f454ed167a9b6b7090fa7e.
Reason for revert: This breaks QtDeclarative Integrity builds now due
to conditional noexcept.
Change-Id: Ibd1493f77b4122938b958d9f0bda0895ddc81445
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/tools/qsharedpointer.cpp')
| -rw-r--r-- | src/corelib/tools/qsharedpointer.cpp | 77 |
1 files changed, 44 insertions, 33 deletions
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index 9ed48338e99..217a3a4ff43 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -16,12 +16,6 @@ \reentrant - \compares strong - \compareswith strong QSharedPointer<X> X* std::nullptr_t - Where X and T are compatible types, which means that they are either the same or one - is a base type of the other. - \endcompareswith - The QSharedPointer is an automatic, shared pointer in C++. It behaves exactly like a normal pointer for normal purposes, including respect for constness. @@ -992,66 +986,83 @@ */ /*! - \fn template<class T, class X> bool operator==(const QSharedPointer<T> &lhs, const QSharedPointer<X> &rhs) + \fn template<class T, class X> bool operator==(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) \relates QSharedPointer - Returns \c true if \a lhs and \a rhs refer to the same pointer. + Returns \c true if \a ptr1 and \a ptr2 refer to the same pointer. -//! [qsharedpointer-different-template-parameters] - If \a rhs's template parameter is different from \a lhs's, - QSharedPointer first needs to ensure that they are compatible types. - It will attempt to perform an automatic \tt static_cast to convert - the types \tt T and \tt X to their composite pointer type. - If \a rhs's template parameter is not a base or a derived type from - \a lhs's, you will get a compiler error. -//! [qsharedpointer-different-template-parameters] + If \a ptr2's template parameter is different from \a ptr1's, + QSharedPointer will attempt to perform an automatic \tt static_cast + to ensure that the pointers being compared are equal. If \a ptr2's + template parameter is not a base or a derived type from + \a ptr1's, you will get a compiler error. */ /*! - \fn template<class T, class X> bool operator!=(const QSharedPointer<T> &lhs, const QSharedPointer<X> &rhs) + \fn template<class T, class X> bool operator!=(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) \relates QSharedPointer - Returns \c true if \a lhs and \a rhs refer to distinct pointers. + Returns \c true if \a ptr1 and \a ptr2 refer to distinct pointers. - \include qsharedpointer.cpp qsharedpointer-different-template-parameters + If \a ptr2's template parameter is different from \a ptr1's, + QSharedPointer will attempt to perform an automatic \tt static_cast + to ensure that the pointers being compared are equal. If \a ptr2's + template parameter is not a base or a derived type from + \a ptr1's, you will get a compiler error. */ /*! - \fn template<class T, class X> bool operator==(const QSharedPointer<T> &lhs, const X *rhs) + \fn template<class T, class X> bool operator==(const QSharedPointer<T> &ptr1, const X *ptr2) \relates QSharedPointer - Returns \c true if \a lhs and \a rhs refer to the same pointer. + Returns \c true if \a ptr1 and \a ptr2 refer to the same pointer. - \include qsharedpointer.cpp qsharedpointer-different-template-parameters + If \a ptr2's type is different from \a ptr1's, + QSharedPointer will attempt to perform an automatic \tt static_cast + to ensure that the pointers being compared are equal. If \a ptr2's + type is not a base or a derived type from this + \a ptr1's, you will get a compiler error. */ /*! - \fn template<class T, class X> bool operator!=(const QSharedPointer<T> &lhs, const X *rhs) + \fn template<class T, class X> bool operator!=(const QSharedPointer<T> &ptr1, const X *ptr2) \relates QSharedPointer - Returns \c true if \a lhs and \a rhs refer to distinct pointers. + Returns \c true if \a ptr1 and \a ptr2 refer to distinct pointers. - \include qsharedpointer.cpp qsharedpointer-different-template-parameters + If \a ptr2's type is different from \a ptr1's, + QSharedPointer will attempt to perform an automatic \tt static_cast + to ensure that the pointers being compared are equal. If \a ptr2's + type is not a base or a derived type from this + \a ptr1's, you will get a compiler error. */ /*! - \fn template<class T, class X> bool operator==(const T *lhs, const QSharedPointer<X> &rhs) + \fn template<class T, class X> bool operator==(const T *ptr1, const QSharedPointer<X> &ptr2) \relates QSharedPointer - Returns \c true if the pointer \a lhs is the - same pointer as that referenced by \a rhs. + Returns \c true if the pointer \a ptr1 is the + same pointer as that referenced by \a ptr2. - \include qsharedpointer.cpp qsharedpointer-different-template-parameters + If \a ptr2's template parameter is different from \a ptr1's type, + QSharedPointer will attempt to perform an automatic \tt static_cast + to ensure that the pointers being compared are equal. If \a ptr2's + template parameter is not a base or a derived type from + \a ptr1's type, you will get a compiler error. */ /*! - \fn template<class T, class X> bool operator!=(const T *lhs, const QSharedPointer<X> &rhs) + \fn template<class T, class X> bool operator!=(const T *ptr1, const QSharedPointer<X> &ptr2) \relates QSharedPointer - Returns \c true if the pointer \a lhs is not the - same pointer as that referenced by \a rhs. + Returns \c true if the pointer \a ptr1 is not the + same pointer as that referenced by \a ptr2. - \include qsharedpointer.cpp qsharedpointer-different-template-parameters + If \a ptr2's template parameter is different from \a ptr1's type, + QSharedPointer will attempt to perform an automatic \tt static_cast + to ensure that the pointers being compared are equal. If \a ptr2's + template parameter is not a base or a derived type from + \a ptr1's type, you will get a compiler error. */ /*! |
