add == for DNSName (it is a bit stupid now)

This commit is contained in:
bert hubert
2018-10-15 09:29:41 +02:00
parent fe72276ec0
commit 53b6d2cc5a

View File

@ -149,7 +149,12 @@ struct DNSName
std::string toString() const;
bool operator==(const DNSName& rhs) const
{
return std::lexicographical_compare(begin(), end(), rhs.begin(), rhs.end())==0;
return std::lexicographical_compare(begin(), end(), rhs.begin(), rhs.end())==0 &&
std::lexicographical_compare(rhs.begin(), rhs.end(), begin(), end())==0;
}
bool operator<(const DNSName& rhs) const
{
return std::lexicographical_compare(begin(), end(), rhs.begin(), rhs.end());
}
std::deque<DNSLabel> d_name;