summaryrefslogtreecommitdiff
path: root/zen/ring_buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'zen/ring_buffer.h')
-rw-r--r--zen/ring_buffer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/zen/ring_buffer.h b/zen/ring_buffer.h
index ae2377d8..dfbb6493 100644
--- a/zen/ring_buffer.h
+++ b/zen/ring_buffer.h
@@ -182,6 +182,7 @@ public:
Iterator(Container& container, size_t offset) : container_(&container), offset_(offset) {}
Iterator& operator++() { ++offset_; return *this; }
+ Iterator& operator--() { --offset_; return *this; }
Iterator& operator+=(ptrdiff_t offset) { offset_ += offset; return *this; }
inline friend bool operator==(const Iterator& lhs, const Iterator& rhs) { assert(lhs.container_ == rhs.container_); return lhs.offset_ == rhs.offset_; }
inline friend ptrdiff_t operator-(const Iterator& lhs, const Iterator& rhs) { return lhs.offset_ - rhs.offset_; }
@@ -226,7 +227,7 @@ private:
static T* uninitializedMoveIfNoexcept(T* first, T* last, T* firstTrg, std::true_type ) { return std::uninitialized_move(first, last, firstTrg); }
static T* uninitializedMoveIfNoexcept(T* first, T* last, T* firstTrg, std::false_type) { return std::uninitialized_copy(first, last, firstTrg); } //throw ?
- void checkInvariants()
+ void checkInvariants() const
{
assert(bufStart_ == 0 || bufStart_ < capacity_);
assert(size_ <= capacity_);
bgstack15