fix + and - bugs in iterator
This commit is contained in:
@ -19,14 +19,17 @@ namespace bse {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
ContinuousIterator operator+(std::size_t add) {
|
ContinuousIterator& operator--() {
|
||||||
this->ptr += add;
|
--this->ptr;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ContinuousIterator operator+(std::size_t add) {
|
||||||
|
return ContinuousIterator(this->ptr + add);
|
||||||
|
}
|
||||||
|
|
||||||
ContinuousIterator operator-(std::size_t sub) {
|
ContinuousIterator operator-(std::size_t sub) {
|
||||||
this->ptr -= sub;
|
return ContinuousIterator(this->ptr - sub);
|
||||||
return *this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convenience
|
// Convenience
|
||||||
@ -40,7 +43,7 @@ namespace bse {
|
|||||||
bool operator>(const ContinuousIterator& other) const { return this->ptr > other.ptr; }
|
bool operator>(const ContinuousIterator& other) const { return this->ptr > other.ptr; }
|
||||||
bool operator>=(const ContinuousIterator& other) const { return this->ptr >= other.ptr; }
|
bool operator>=(const ContinuousIterator& other) const { return this->ptr >= other.ptr; }
|
||||||
bool operator==(const ContinuousIterator& other) const { return this->ptr == other.ptr; }
|
bool operator==(const ContinuousIterator& other) const { return this->ptr == other.ptr; }
|
||||||
bool operator!=(const ContinuousIterator& other) const { return !(*this == other); }
|
bool operator!=(const ContinuousIterator& other) const { return this->ptr != other.ptr; }
|
||||||
|
|
||||||
template<typename t>
|
template<typename t>
|
||||||
friend std::size_t distance(const ContinuousIterator<t>& first, const ContinuousIterator<t>& last);
|
friend std::size_t distance(const ContinuousIterator<t>& first, const ContinuousIterator<t>& last);
|
||||||
|
|||||||
Reference in New Issue
Block a user