git-svn-id: svn://db.shs.com.ru/pip@506 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2017-05-31 14:16:24 +00:00
parent 75ea531673
commit 82c985f272
5 changed files with 145 additions and 75 deletions

View File

@@ -181,6 +181,8 @@ public:
inline bool operator !=(const PIDeque<T> & t) const {if (pid_size != t.pid_size) return true; for (size_t i = 0; i < pid_size; ++i) if (t[i] != (*this)[i]) return true; return false;}
inline bool contains(const T & v) const {for (size_t i = pid_start; i < pid_start + pid_size; ++i) if (v == pid_data[i]) return true; return false;}
inline int etries(const T & v) const {int ec = 0; for (size_t i = pid_start; i < pid_start + pid_size; ++i) if (v == pid_data[i]) ++ec; return ec;}
inline ssize_t indexOf(const T & v) const {for (ssize_t i = pid_start; i < pid_start + pid_size; ++i) if (v == pid_data[i]) return i - pid_start; return -1;}
inline ssize_t lastIndexOf(const T & v) const {for (ssize_t i = pid_start + pid_size - 1; i >= pid_start; --i) if (v == pid_data[i]) return i - pid_start; return -1;}
inline T * data(size_t index = 0) {return &(pid_data[pid_start + index]);}
inline const T * data(size_t index = 0) const {return &(pid_data[pid_start + index]);}