Commit 93091020 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Allow checking KeyPairInfo for equality

GnuPG-bug-id: 4876
parent 377ac424
......@@ -82,3 +82,19 @@ void KeyPairInfo::update(const KeyPairInfo &other)
algorithm = other.algorithm;
}
}
// C++20: Replace with defaulted equality operator
bool KeyPairInfo::operator==(const KeyPairInfo &other) const
{
return keyRef == other.keyRef
&& grip == other.grip
&& usage == other.usage
&& keyTime == other.keyTime
&& algorithm == other.algorithm;
}
// C++20: Remove
bool KeyPairInfo::operator!=(const KeyPairInfo &other) const
{
return !operator==(other);
}
......@@ -24,6 +24,9 @@ struct KeyPairInfo {
void update(const KeyPairInfo &other);
bool operator==(const KeyPairInfo &other) const;
bool operator!=(const KeyPairInfo &other) const;
std::string keyRef;
std::string grip;
std::string usage;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment