From 7c910b79e56ffae88578958374e7e78c97b44cdd Mon Sep 17 00:00:00 2001 From: Ferdinand Bachmann Date: Sat, 18 Apr 2020 14:37:52 +0200 Subject: [PATCH] also fix pointer to ref conversion for non-const iterators --- include/ring-buffer-iterator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ring-buffer-iterator.h b/include/ring-buffer-iterator.h index 8b6e800..6954835 100644 --- a/include/ring-buffer-iterator.h +++ b/include/ring-buffer-iterator.h @@ -35,10 +35,10 @@ public: } CONSTEXPR ring_buffer_iterator operator+(difference_type n) const NOEXCEPT { - return {container_ptr, front, index + n}; + return {*container_ptr, front, index + n}; } CONSTEXPR ring_buffer_iterator operator-(difference_type n) const NOEXCEPT { - return {container_ptr, front, index - n}; + return {*container_ptr, front, index - n}; } CONSTEXPR reference operator*() COND_NOEXCEPT(noexcept(container_ptr->begin()) &&noexcept(container_ptr->size())) {