summaryrefslogtreecommitdiff
path: root/asn.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-10-01 02:09:43 -0400
committerJeffrey Walton <noloader@gmail.com>2019-10-01 02:09:43 -0400
commit6687baf7ba3d959f89b7787b0546a77a15d93e82 (patch)
tree874e55d2c992ccd09938e912fe0ae7a4e77db4db /asn.h
parentfa6181f9505a7439fc5244ea63f2bc74df3620c3 (diff)
downloadcryptopp-git-6687baf7ba3d959f89b7787b0546a77a15d93e82.tar.gz
Add OID operator<= and operator>=
I thought the compiler was supposed to deduce these from operator== and operator<, but not for GCC 7.2
Diffstat (limited to 'asn.h')
-rw-r--r--asn.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/asn.h b/asn.h
index 0c39155d..e0abba26 100644
--- a/asn.h
+++ b/asn.h
@@ -868,6 +868,10 @@ inline bool operator!=(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
{return lhs.m_values != rhs.m_values;}
inline bool operator<(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
{return std::lexicographical_compare(lhs.m_values.begin(), lhs.m_values.end(), rhs.m_values.begin(), rhs.m_values.end());}
+inline bool operator<=(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
+ {return lhs<rhs || lhs==rhs;}
+inline bool operator>=(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
+ {return ! (lhs<rhs);}
inline ::CryptoPP::OID operator+(const ::CryptoPP::OID &lhs, unsigned long rhs)
{return ::CryptoPP::OID(lhs)+=rhs;}
inline std::ostream& operator<<(std::ostream& out, const OID &oid)