diff options
author | Andreas Buhr <andreas@andreasbuhr.de> | 2021-03-02 13:58:17 +0100 |
---|---|---|
committer | Andreas Buhr <andreas@andreasbuhr.de> | 2021-03-12 19:17:09 +0100 |
commit | 9c59558afc71f36a82a1cab9ca0841119892e26a (patch) | |
tree | 1bf93e363f1c65abffc82a4c92f93dd1428374fb /src/bluetooth/qlowenergycharacteristicdata.cpp | |
parent | a2be117fe1a8dbcd00686e4c71db8a2cfdfa7326 (diff) |
Make comparison operators hidden friends in QtBluetooth
This patch changes all comparison operators in QtBluetooth
to hidden friends. Thereby, they are symmetric and can only
be found through ADL, not polluting the global namespace.
Fixes: QTBUG-91553
Change-Id: I4357dd3fee51beb86e68a9c7a01ea6b6c93f135f
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'src/bluetooth/qlowenergycharacteristicdata.cpp')
-rw-r--r-- | src/bluetooth/qlowenergycharacteristicdata.cpp | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/bluetooth/qlowenergycharacteristicdata.cpp b/src/bluetooth/qlowenergycharacteristicdata.cpp index 700566a6..a677f54a 100644 --- a/src/bluetooth/qlowenergycharacteristicdata.cpp +++ b/src/bluetooth/qlowenergycharacteristicdata.cpp @@ -254,27 +254,34 @@ bool QLowEnergyCharacteristicData::isValid() const */ /*! - Returns \c true if \a cd1 and \a cd2 are equal with respect to their public state, - otherwise returns \c false. + \brief Returns \c true if \a a and \a b are equal with respect to their public state, + otherwise returns \c false. + \internal */ -bool operator==(const QLowEnergyCharacteristicData &cd1, const QLowEnergyCharacteristicData &cd2) +bool QLowEnergyCharacteristicData::equals(const QLowEnergyCharacteristicData &a, + const QLowEnergyCharacteristicData &b) { - return cd1.d == cd2.d || ( - cd1.uuid() == cd2.uuid() - && cd1.properties() == cd2.properties() - && cd1.descriptors() == cd2.descriptors() - && cd1.value() == cd2.value() - && cd1.readConstraints() == cd2.readConstraints() - && cd1.writeConstraints() == cd2.writeConstraints() - && cd1.minimumValueLength() == cd2.maximumValueLength() - && cd1.maximumValueLength() == cd2.maximumValueLength()); + return a.d == b.d + || (a.uuid() == b.uuid() && a.properties() == b.properties() + && a.descriptors() == b.descriptors() && a.value() == b.value() + && a.readConstraints() == b.readConstraints() + && a.writeConstraints() == b.writeConstraints() + && a.minimumValueLength() == b.maximumValueLength() + && a.maximumValueLength() == b.maximumValueLength()); } /*! - \fn bool operator!=(const QLowEnergyCharacteristicData &cd1, - const QLowEnergyCharacteristicData &cd2) - Returns \c true if \a cd1 and \a cd2 are not equal with respect to their public state, - otherwise returns \c false. + \fn bool QLowEnergyCharacteristicData::operator==(const QLowEnergyCharacteristicData &a, + const QLowEnergyCharacteristicData &b) + \brief Returns \c true if \a a and \a b are equal with respect to their public state, + otherwise returns \c false. + */ + +/*! + \fn bool QLowEnergyCharacteristicData::operator!=(const QLowEnergyCharacteristicData &a, + const QLowEnergyCharacteristicData &b) + \brief Returns \c true if \a a and \a b are not equal with respect to their public state, + otherwise returns \c false. */ QT_END_NAMESPACE |