mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-22 05:05:38 +08:00
Using friend function comparison and arithmetic operators, for parameter symmetry.
This commit is contained in:
@@ -272,10 +272,17 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
//! Equal operator ==
|
||||
bool operator == (const CMeasurementUnit &other) const;
|
||||
friend bool operator == (const CMeasurementUnit &a, const CMeasurementUnit &b)
|
||||
{
|
||||
if (&a == &b) return true;
|
||||
return a.m_data->m_name == b.m_data->m_name;
|
||||
}
|
||||
|
||||
//! Unequal operator !=
|
||||
bool operator != (const CMeasurementUnit &other) const;
|
||||
friend bool operator != (const CMeasurementUnit &a, const CMeasurementUnit &b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
//! \copydoc CValueObject::qHash
|
||||
friend uint qHash(const CMeasurementUnit &unit)
|
||||
|
||||
Reference in New Issue
Block a user