From f6b6d222dc1a79c95f6756c707c5fcc3a785c030 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Sun, 6 Feb 2022 16:41:53 -0500 Subject: add upstream 11.17 --- zen/ring_buffer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'zen/ring_buffer.h') 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_); -- cgit