cpp: Add const-overload of UserID::Signature::operator<

lang/cpp/src/key.h, lang/cpp/src/key.cpp (UserID::Signature::operator<):
Add const-overload. Deprecate non-const overload.

--

This fixes compilation on FreeBSD with clang 10.
This commit is contained in:
Ingo Klöcker 2021-01-04 16:29:36 +01:00
parent 543e210638
commit a6220adf30
2 changed files with 9 additions and 1 deletions

View File

@ -866,6 +866,12 @@ UserID::Signature::Signature(const shared_gpgme_key_t &k, gpgme_user_id_t u, gpg
} }
bool UserID::Signature::operator<(const Signature &other) bool UserID::Signature::operator<(const Signature &other)
{
// kept for binary compatibility
return static_cast<const UserID::Signature *>(this)->operator<(other);
}
bool UserID::Signature::operator<(const Signature &other) const
{ {
// based on cmp_signodes() in g10/keylist.c // based on cmp_signodes() in g10/keylist.c

View File

@ -468,7 +468,9 @@ public:
} }
/*! Defines a canonical sort order for signatures of the same user ID. */ /*! Defines a canonical sort order for signatures of the same user ID. */
bool operator<(const Signature &other); bool operator<(const Signature &other) const;
GPGMEPP_DEPRECATED bool operator<(const Signature &other);
bool isNull() const bool isNull() const
{ {