From: Alex Rousskov Date: Mon, 23 Aug 2010 23:25:09 +0000 (-0600) Subject: Added more comparison operators to HttpVersion. X-Git-Tag: take1~343 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=922b9825a31d6cbd4c3b1738d0c45cda0efd9373;p=thirdparty%2Fsquid.git Added more comparison operators to HttpVersion. --- diff --git a/src/HttpVersion.h b/src/HttpVersion.h index fb19b2b3bf..43952c91f1 100644 --- a/src/HttpVersion.h +++ b/src/HttpVersion.h @@ -66,6 +66,23 @@ public: return ((this->major != that.major) || (this->minor != that.minor)); } + bool operator <(const HttpVersion& that) const { + return (this->major < that.major || + this->major == that.major && this->minor < that.minor); + } + + bool operator >(const HttpVersion& that) const { + return (this->major > that.major || + this->major == that.major && this->minor > that.minor); + } + + bool operator <=(const HttpVersion& that) const { + return !(*this > that); + } + + bool operator >=(const HttpVersion& that) const { + return !(*this < that); + } }; #endif /* SQUID_HTTPVERSION_H */