Ring buffer: Fix iterator operator + and -

This commit is contained in:
Jonathan G Rennison
2023-08-19 11:41:11 +01:00
parent 21adf399c0
commit 6b8994c947

View File

@@ -160,7 +160,7 @@ public:
ring_buffer_iterator operator +(std::ptrdiff_t delta) const ring_buffer_iterator operator +(std::ptrdiff_t delta) const
{ {
ring_buffer_iterator tmp = *this; ring_buffer_iterator tmp = *this;
this->move(delta); tmp += delta;
return tmp; return tmp;
} }
@@ -173,7 +173,7 @@ public:
ring_buffer_iterator operator -(std::ptrdiff_t delta) const ring_buffer_iterator operator -(std::ptrdiff_t delta) const
{ {
ring_buffer_iterator tmp = *this; ring_buffer_iterator tmp = *this;
this->move(-delta); tmp -= delta;
return tmp; return tmp;
} }