From e3808aafa7a395d365161108212b9d4aa94d690c Mon Sep 17 00:00:00 2001 From: ChUrl Date: Fri, 29 Jul 2022 14:35:12 +0200 Subject: [PATCH] constcast pointer in iterator --- c_os/user/lib/Iterator.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c_os/user/lib/Iterator.h b/c_os/user/lib/Iterator.h index 18019ac..ea6ce01 100644 --- a/c_os/user/lib/Iterator.h +++ b/c_os/user/lib/Iterator.h @@ -12,7 +12,8 @@ namespace bse { public: ContinuousIterator() = delete; - ContinuousIterator(T* ptr) : ptr(ptr) {} + // Use const_cast as the iterator has to increment the pointer + ContinuousIterator(const T* ptr) : ptr(const_cast(ptr)) {} ContinuousIterator& operator++() { ++ptr;