1

constcast pointer in iterator

This commit is contained in:
2022-07-29 14:35:12 +02:00
parent fa0bfee566
commit e3808aafa7

View File

@ -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<T*>(ptr)) {}
ContinuousIterator& operator++() {
++ptr;