QHostAddress: add missing op!=(SpecialAddress, QHostAddress)
The equality operator was supplied, but this one was missing. [ChangeLog][QtNetwork][QHostAddress] Added op!=(SpecialAddress, QHostAddress). Change-Id: Iad9c55fa0ee7a8e97d5e4ea4be0605b8b74649d1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
a9603a4088
commit
c2cecf08d5
@ -1258,6 +1258,18 @@ uint qHash(const QHostAddress &key, uint seed) Q_DECL_NOTHROW
|
||||
|
||||
\sa isEqual()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\relates QHostAddress
|
||||
\since 5.9
|
||||
\fn operator!=(QHostAddress::SpecialAddress lhs, const QHostAddress &rhs)
|
||||
|
||||
Returns \c false if special address \a lhs is the same as host address \a rhs;
|
||||
otherwise returns \c true.
|
||||
|
||||
\sa isEqual()
|
||||
*/
|
||||
|
||||
#ifndef QT_NO_DATASTREAM
|
||||
|
||||
/*! \relates QHostAddress
|
||||
|
@ -161,6 +161,8 @@ Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QHostAddress)
|
||||
|
||||
inline bool operator ==(QHostAddress::SpecialAddress address1, const QHostAddress &address2)
|
||||
{ return address2 == address1; }
|
||||
inline bool operator!=(QHostAddress::SpecialAddress lhs, const QHostAddress &rhs)
|
||||
{ return rhs != lhs; }
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
Q_NETWORK_EXPORT QDebug operator<<(QDebug, const QHostAddress &);
|
||||
|
@ -274,6 +274,7 @@ void tst_QHostAddress::specialAddresses()
|
||||
QVERIFY(address == QHostAddress(address));
|
||||
QVERIFY(!(QHostAddress(address) != QHostAddress(address)));
|
||||
QVERIFY(!(QHostAddress(address) != address));
|
||||
QVERIFY(!(address != QHostAddress(address)));
|
||||
|
||||
{
|
||||
QHostAddress ha;
|
||||
|
Loading…
Reference in New Issue
Block a user