PIVector compare operators
This commit is contained in:
@@ -191,6 +191,18 @@ public:
|
||||
return true;
|
||||
}
|
||||
inline bool operator !=(const PIVector<T> & t) const {return !(*this == t);}
|
||||
inline bool operator <(const PIVector<T> & t) const {
|
||||
if (piv_size != t.piv_size) return piv_size < t.piv_size;
|
||||
for (size_t i = 0; i < piv_size; ++i)
|
||||
if ((*this)[i] != t[i]) return (*this)[i] < t[i];
|
||||
return false;
|
||||
}
|
||||
inline bool operator >(const PIVector<T> & t) const {
|
||||
if (piv_size != t.piv_size) return piv_size > t.piv_size;
|
||||
for (size_t i = 0; i < piv_size; ++i)
|
||||
if ((*this)[i] != t[i]) return (*this)[i] > t[i];
|
||||
return false;
|
||||
}
|
||||
inline bool contains(const T & v) const {
|
||||
for (size_t i = 0; i < piv_size; ++i)
|
||||
if (v == piv_data[i])
|
||||
|
||||
Reference in New Issue
Block a user