PIByteArray compare operators

This commit is contained in:
2021-08-12 21:41:22 +03:00
parent ee131921a0
commit 39a3a23a24
2 changed files with 23 additions and 23 deletions

View File

@@ -190,10 +190,16 @@ public:
return true;
}
inline bool operator !=(const PIDeque<T> & t) const {return !(*this == t);}
inline bool operator <(const PIDeque<T> & t) const {
if (pid_size != t.pid_size) return pid_size < t.pid_size;
for (size_t i = 0; i < pid_size; ++i)
if ((*this)[i] != t[i]) return (*this)[i] < t[i];
return false;
}
inline bool operator >(const PIDeque<T> & t) const {
if (pid_size != t.pid_size) return pid_size > t.pid_size;
for (size_t i = 0; i < pid_size; ++i)
if (t[i] != (*this)[i]) return t[i] > (*this)[i];
if ((*this)[i] != t[i]) return (*this)[i] > t[i];
return false;
}
inline bool contains(const T & v) const {