Ring buffer: Don't apply const when dereferencing iterators

This commit is contained in:
Jonathan G Rennison
2023-08-19 13:54:52 +01:00
parent 0c634edef5
commit b59a8dc21c

View File

@@ -102,27 +102,15 @@ public:
using difference_type = std::ptrdiff_t;
using value_type = T;
using reference = V &;
using const_reference = const V &;
using pointer = V *;
using const_pointer = const V *;
using iterator_category = std::bidirectional_iterator_tag;
reference operator *()
reference operator *() const
{
return *this->ring->ptr_at_pos(this->pos);
}
const_reference operator *() const
{
return *this->ring->ptr_at_pos(this->pos);
}
pointer operator ->()
{
return this->ring->ptr_at_pos(this->pos);
}
const_pointer operator ->() const
pointer operator ->() const
{
return this->ring->ptr_at_pos(this->pos);
}