From 0ac0b412c754e53d167716f207be9d76a7fe16be Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Tue, 9 Jul 2024 09:23:22 +0000 Subject: 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 --- src/corelib/tools/qsharedpointer.cpp | 77 ++++++++++++++++++++---------------- 1 file changed, 44 insertions(+), 33 deletions(-) (limited to 'src/corelib/tools/qsharedpointer.cpp') 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* 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 bool operator==(const QSharedPointer &lhs, const QSharedPointer &rhs) + \fn template bool operator==(const QSharedPointer &ptr1, const QSharedPointer &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 bool operator!=(const QSharedPointer &lhs, const QSharedPointer &rhs) + \fn template bool operator!=(const QSharedPointer &ptr1, const QSharedPointer &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 bool operator==(const QSharedPointer &lhs, const X *rhs) + \fn template bool operator==(const QSharedPointer &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 bool operator!=(const QSharedPointer &lhs, const X *rhs) + \fn template bool operator!=(const QSharedPointer &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 bool operator==(const T *lhs, const QSharedPointer &rhs) + \fn template bool operator==(const T *ptr1, const QSharedPointer &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 bool operator!=(const T *lhs, const QSharedPointer &rhs) + \fn template bool operator!=(const T *ptr1, const QSharedPointer &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. */ /*! -- cgit v1.2.3