mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-05-08 04:41:06 -05:00
C++20: Synthesize operator!= From operator==
The inequality operator is automatically generated by the compiler if `operator==` is defined.
This commit is contained in:
@@ -227,21 +227,11 @@ bool DeviceQualifier::operator==(const Device* const dev) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DeviceQualifier::operator!=(const Device* const dev) const
|
||||
{
|
||||
return !operator==(dev);
|
||||
}
|
||||
|
||||
bool DeviceQualifier::operator==(const DeviceQualifier& devq) const
|
||||
{
|
||||
return std::tie(cid, name, source) == std::tie(devq.cid, devq.name, devq.source);
|
||||
}
|
||||
|
||||
bool DeviceQualifier::operator!=(const DeviceQualifier& devq) const
|
||||
{
|
||||
return !operator==(devq);
|
||||
}
|
||||
|
||||
std::shared_ptr<Device> DeviceContainer::FindDevice(const DeviceQualifier& devq) const
|
||||
{
|
||||
std::lock_guard lk(m_devices_mutex);
|
||||
|
||||
@@ -213,10 +213,8 @@ public:
|
||||
std::string ToString() const;
|
||||
|
||||
bool operator==(const DeviceQualifier& devq) const;
|
||||
bool operator!=(const DeviceQualifier& devq) const;
|
||||
|
||||
bool operator==(const Device* dev) const;
|
||||
bool operator!=(const Device* dev) const;
|
||||
|
||||
std::string source;
|
||||
int cid;
|
||||
|
||||
Reference in New Issue
Block a user